This has been observed frequently that dogs do not like to be pet at bedtime. He looks displeased at this time being a pet. He feels the same way. Like humans feel sad. When they have trouble sleeping, dogs do not like to be petted while sleeping.