It seems that Bubble is not correctly processing dynamic values in the HTML block. The issue might be related to how the data is passed to the three.js script.
What helped me in a similar situation:
Use console.log in the HTML to check if the URL and index values are actually being passed to the script.
Explicitly prepend https:// to the URL in the workflow, not just in the HTML code.
Use setTimeout() before rendering to ensure the values are available when three.js is called.
However, the issue might also be due to a delay in Bubble updating the values.