This could definitely be caused by wireless charging not being efficient enough to put enough power in the phone while the phone is being worked. Running CarPlay with navigation and music, for example, is a pretty heavy workload for a tiny computer that fits in your pocket.
And, as others have mentioned, wireless charging is
very sensitive to positioning. As the phone gets farther away from the optimal position, that efficiency drops - even if the phone still shows it's receiving power.
For context my phone, an iPhone 12 Mini, does gain charge while plugged in via the USB A port, though it's quite slow. I haven't tried the wireless charging with it. I love the reliability, consistency, and guaranteed higher efficiency of wired charging. Got myself a 6" USB -> Lightning cable so that it doesn't take up much room in the compartment.