Hi Taras,
Can you provide a link to the web page where you have embedded the widget? Your code works fine when using a direct link to embed the form, so I suspect it has to do with the page load as you suggested. If you'd prefer, you can open a ticket to provide your example and reference this forum post.