According to WhatsApp’s blog, “Connecting via proxy maintains the high level of privacy and security that WhatsApp provides. Your personal messages will still be protected by end-to-end encryption — ensuring they stay between you and the person you’re communicating with and are not visible to anyone in between, not the proxy servers, WhatsApp, or Meta.”
It is worth noting that use of a third-party proxy will share your IP address with the proxy provider. Third-party proxies aren't provided by WhatsApp.