The good news is that there is an easy fix.
Sometimes, the computer does sleep but gets woken by that slight mouse movement when someone walks by or something causes vibration to the surface it lies on. You may not even realize that your mouse absorbs even the smallest of vibrations from your surroundings, and that action simply doesn’t allow your PC to go into sleep mode.