com.whatsapp_preferences.xml periodically gets overwritten how to prevent that from happening
Changing the permissions of the file can solve the problem.
Get the WhatsApp system group, you can use:
ls -la /data/data/com.whatsapp                                                       

Let's suppose that the WhatsApp system group is u0_a301.
Change the owner of the file to root and the group to WhatsApp group:
chown root:u0_a301 /data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml

Then remove the write permission to the group:
chmod 640 /data/data/com.whatsapp/shared_prefs/com.whatsapp_preferences.xml

That will prevent WhatsApp from writing the file and it can read it.