MacBook doesn't lock after closing the lid
I have a MacBook Air (M1), and when I close the lid, it doesn't lock, and the screen is still on. I just got my device back from a service (a bit of water was spilt on it, but the service said that they were able to clean it, and it works perfectly); previously, I didn't have this problem at all. I tried to look for solutions online, but the mentioned sudo pmset -a disablesleep code didn't work at all, and the 'require password after screen saver begins or display turned off' is also set to immediately.
Any suggestion on what the problem can be?
Many thanks in advance!
MacBook Air 13″