Just want to tag onto the replies in case it helps somebody down the road. I had an issue where my CarPlay stopped working altogether. Initially, I thought it was the port in the car (2022 Subaru Legacy). I tried multiple cables and cars and my phone would basically charge for 3 seconds, then disconnect. This would continuously cycle in this manner until I unplugged my phone. It did work prior with no issues for a few months. When I would plug in my phone at home, it would charge as normal or connect to a PC as normal.
Ultimately, what I ended up doing to fix this problem without needing to purchase additional adapters or cables:
Checked for updates: Updated to 17.4
Go into Settings >> General >> CarPlay
Delete the vehicle that you are having the issue with (Forget This Car).
Go to Settings >> Face ID & Passcode - type in passkey
Scroll to bottom and turn on Accessories if it's not already. (Not sure if this actually did anything as it was never on prior, but I saw someone said it helped for them, so I did it anyway)
Finally, Settings >> Screen Time >> Content & Privacy Restrictions
Make sure this is either switched OFF or if it is ON, click Allowed Apps and make sure CarPlay is turned on.
After I performed these steps, I went back out to my car and CarPlay connected immediately with no issues! Hoping this helps someone in the future!