I got it fixed. Claude gave me a working answer. All I needed to do was add:
com.apple.security.temporary-exception.apple-events
With items
com.spotify.client
And
com.apple.systemevents
To the entitlements.
Topic:
App & System Services
SubTopic:
Automation & Scripting