I have a 2022 Prius. I am also still using an iPhone 8. For the past several months the Apple CarPlay feature will terminate for no known reason. I could be listening to music or using maps or charging my phone. First I thought it was my cable (after market Apple certified). This didn't make a difference. I thought it was a defect in the USB port in the center console (still under warranty). I took my car to the dealer, He told me the following. It was essential that I use an Apple Lightening cord to plug into the USB port in the console. Second, Toyota recommended use of iPhone 11 or later! I just replaced my cord with an Apple. Do you think this will fix the problem or might it be a defective USB port? Or is it my phone too old (the iOS system is up to date). Thoughts?
Your phone was manufactured around 2017. I had a similar problem, only it was on my 2012 Prius on bluetooth. It worked flawlessly until I upgraded my Galaxy in about 2015 or 2016. The newer phone refused to connect. A couple years later, after a phone update, it suddenly started working again. I def. would get Apple's cable. Have you run all he updates for the phone?
My experience is that Carplay is VERY picky about cables. In my aftermarket carplay unit, I often have to change cables to solve the issue you are describing. The cables work perfectly fine for other things, but Carplay doesnt like them. I finalky resorted to keeping a few cables in my car, and just swap through them when Carplay keeps disconnecting. In my Prius, I use wireless carplay, and the disconnect issue has never happened.
On our Gen4 Prius that I traded in for a Kia Niro, I used a cplay2air gizmo plugged into the usb port to give me wireless CarPlay. Took maybe 10-20 seconds to connect. Flawless — may have had to remove and plug it back in a couple of times. I highly recommend it. the same gizmo worked in our Niro until some random software update in the Niro, and then stopped working. I bought another one (newer! Shinier!) and that one is now working flawlessly.