Mazda5 Key and Electrical Issues (2012 1.6L Diesel)

My partner has been having issues with her (5) it’s a 2012 1.6 Diesel

She popped in a shop earlier and when she came back to open the car with fob controlled central locking, it would not work, she undid the door manually but there was no lights on dash, when key was in ignition, nor would anything electrical’s work. She left the car outside the shop.

I had a look myself after work , popped the bonnet tested main battery which is all fine. I opened and closed a couple of the doors and the red light (alarm / immobiliser) under ignition, started to flash again.

This enabled me to use the fob once again and start the car.

Any ideas what might be causing? The other night she came home from work and couldn’t lock the car using central locking. Fob batteries have been changed.

Just don’t really get why , when’s it’s playing up you get no lights on the dash, is this something to do with an immobiliser knowing you have not used the fob to undue the locks and therefore doing it’s job to immobilise the vehicle but surely you would still have electrical things in the car working, whether it prevents you from starting the car or not.

Appreciate any advice you can give.
Get the battery load tested if you didn't load test it.

Clean the terminals on the battery. Check cables to see if they are corroded internally.

Check all engine and body grounds for corrosion.