Never put a sleeping or hibernating computer in a bag. There is a risk of overheating and damage.  See this warning with other info here-- FAQ - Laptop battery articles - Dell Community The latch on your computer might be faulty. I would take it to a trusted repair shop or rig something so it does not happen.
After I close the computer cover and make sure that it goes to sleep, for some reason, I put it in my bag and realize that it opens on the way to work. The mouse is definitely off. Why could it be?
Dell LAtitude 5501 The computer opens in the bag.