Magnetic lock does not lock
Magnetic locks are set up in one of two modes: 1) fail safe, or 2) fail secure. Sounds like yours is “fail safe”.

1) Fail safe mode allows the door to open when the electricity goes out. We use this mode in apartments, commercial buildings, etc. 

2) Fail secure mode locks the door and prohibits access when he electricity goes out. We use this mode in jails, etc. 

It appears you have a circuit breaker that is very sensitive or overloaded, which is causing the circuit to trip and making the magnetic lock go into “fail safe” mode...leaving the door unlocked and open. 

One means of fixing your problem is to add a battery backup.