It's not possible to hit the oembed endpoint from client-side JS. Try running this in your browser console on any non-Spotify domain:
await fetch('https://open.spotify.com/oembed?url=https://open.spotify.com/track/6fHxL22apYBSywdSSZlp6h').then(r => r.json())
You will get a CORS error. For reference, YouTube, SoundCloud, Vimeo have CORS-enabled oembed endpoints.