The irrational act isn't locking the fridge, it's snacking at midnight--you gain weight, use up food, and get less sleep.
Locking up the fridge at night is perfectly reasonable if you want to lose weight.