WhatsApp doesn't follow the SIM
WhatsApp is tied to the number you registered, not the SIM in use. Switching mobile data to a travel eSIM keeps WhatsApp on your home number.
Keep your home line on
Leave your home SIM switched on for calls and texts, but turn off its data roaming. Then two-factor codes by SMS still arrive, and you won't pay roaming for data.
The settings
iPhone: Settings, Mobile data, set the travel eSIM as Mobile data and switch off 'Allow mobile data switching'. Android: Settings, SIMs, set the travel eSIM for mobile data.