I hit the exact same error (see here). By the way you might want to try adding the MusicKit tag to your post.
So far for the WWDC22 enhancements to MusicKit I’m finding:
Catalyst isn’t supported, period
iPad is meant to be supported but doesn’t work
iPhone kind-of works but good luck getting any help or support when you have questions
I’m disappointed, to put it mildly.
Topic:
Media Technologies
SubTopic:
General
Tags: