I too have occasional problems with Apple CarPlay. It is inconsistent, behaving differently at different times, although I have not had random disconnections. The latest irritation is the request to unlock the phone before it will work. I don't understand this, because nothing has changed from previous times when I put the phone in the car and I did not unlock the phone.
I have a recall in hand that is for updating the infotainment software, so we'll see if that changes anything.