I have a Wyze Contact Sensor and it seems that to replace the battery you need to remove the sensor from the surface it is stuck to. This dramatically shortens the lifespan of the adhesive and you practically need to replace the adhesive every time you replace the battery.
Could the battery door be accessible from the other side perhaps? You would just need to engineer the slot for the key on the opposite side of the magnet.