I have a iPhone xr and text message vibrate and sound does not work unless plugged into my Carplay.

Phone, other notifications, email and calendar alerts work, just not text messages.
Have you checked the mute switch on the side of your phone and/or settings?
Welcome to iMore

Go to Settings>Sound & Haptics and make sure you have messages set to an Alert Tone

Original thread: https://forums.imore.com/threads/i-have-a-iphone-xr-and-text-message-vibrate-and-sound-does-not-work-unless-plugged-into-my-carplay.411305/