When a track is playing in the Music app, Music's AppleScript properties current track and current playlist will be references to that track and the playlist it is playing from. If you have written a script or an app that, for example, displays a notification with the title, artist, album and duration of the currently playing track, current track is who to ask.
Now in Big Sur and Music v1.1, the current track and current playlist will be an "unknown object type" if the track is streaming from Apple Music; this is not a problem if a current track is a local track.
I've already heard from a couple of devs who've run into this issue with their apps and I'm afraid there's no workaround that I'm aware of. The best you can do is account for the error that the call to current track will generate if a non-local track is playing.
I never know if these sorts of things are intentional or not. You certainly shouldn't be able to edit the tags of a streaming track. But I'm not sure why grabbing displayable info—that, to a degree, is otherwise available via "Get Info"—should be hands-off.