Hello, Caromien.
Let's start off by checking the helpful steps in this article: Use CarPlay with your iPhone. It explains that many types of audio content that would normally come through your iPhone's speaker, will instead come through your vehicle via CarPlay. There is not a way within the software to make your WhatsApp messages not follow those instructions from CarPlay. You may wish to reach out to WhatsApp support directly to inquire if they have other suggestions to manipulate their app's settings to allow this.
Let us know if we can help with anything else at all or if this doesn't settle your issue. Thanks and have a fabulous day!