If you are seeing [object Promise] in your output it could be due to a missing await or returning a promise instead of the html string. You didn't post the surrounding function this code is in or which plugin hook it is using so can't really tell what is causing it.