It wouldn’t be a Spotify issue if toggling Bluetooth solves it since Spotify doesn’t directly talk to the AirPods, it goes through iOS. iOS is responsible for compressing the audio stream and then transmitting it to the AirPods (or any other BT headset). So it's either on the iOS side or the AirPods side.
No, Apple is more advanced than that. Music apps pass AAC audio through to iOS. iOS realizes you're using AirPods and instead of recompressing, streams AAC direct to the AirPods, where they are decoded. This saves the power and quality cost of a transcode, and avoids low-quality Bluetooth algorithms like SBC.