Hello . Welcome to the Microsoft Community!
Based on your feedback, you are experiencing an issue where your laptop occasionally does not close completely when the lid is closed
You can try the following
Attempt to repair the system:
1. search for CMD, locate the command prompt, and select Run as administrator.
2. Enter the following commands one at a time, making sure to execute the next command only after the previous one completes:
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /RestoreHealth
SFC /Scannow
3. Once the scan is complete, you can check the scan information to see if any problems were detected and fixed.
You can also try clicking on Control Panel
Click Hardware and Sound > Power Options > System Settings
Then check to see if the operations performed while the laptop screen is closed are sleeping.
If it is sleeping, you can change the settings to something else and restart the computer to adjust it to sleep.
Then check if your function is normal
I hope you find the above information helpful!
Kirito|Microsoft Community Support Specialist