Whatsapp doesn't run on background on new Xiaomi
I strongly suspect this is caused by the enhanced App battery saver, which restricts  application activities to a minimum or altogether close an application to save power.

In some miui based Xiaomi phones it can be adjusted here: Security → Battery Usage → App battery saver → (Choose application) → Background settings:



Alternatively on non miui Xiaomi devices it can adjusted under App settings → Battery usage:



You have to turn off this setting or adjust to make sure the target application (Whatsapp) isn't killed in background.