Might offer food for thought:
https://www.renaultforums.co.uk/threads/help-megane-alarm-keeps-going-off.335865/
https://www.meganeownersclub.co.uk/forum/viewtopic.php?t=10497
https://www.meganesport.net/threads/aaaaaghhh-alarm-randomly-going-off.50968/
Interestingly the bonnet sensor is mentioned in almost every thread. Check the rubber boot is OK. If it's not, probably best to replace the sensor or maybe try a lump of rubber stuck to the bit of bonnet that presses on the sensor.
Dffgu
January 2022