How do the sleep sensors in latest Mac laptops work?
Sleep sensors are typically Hall Effect sensors. You can consult this PDF that Apple produces for case manufacturers which illustrates where the sensors are located per device. The PDF is titled: Accessory Design
Guidelines for Apple Devices.

Make sure you're using the correct polarity when orienting the magnet(s) over the sensors, this is likely why they're not working as you're expecting.

References


Trick reveals all 102 hidden magnets in the 2018 iPad Pro