You might want to use topicID
as mentioned at Embedding Discourse Comments via Javascript.
I wouldn’t be surprised if “localhost” is prohibited for various reasons. This would tell your forum server to embed on itself.
If you are using Hugo maybe load the comment template conditionally, or pass baseURL explicitly in the template, so even during development you’ll load discourseEmbedUrl: 'https://foo.com/blog/2019-11-22/foo-0.9.6-released'
.