Yeah I dont see any issue lifting a hide otherwise you may see your snake once in a blue moon ...lol
You say you pet it ? if your stroking near the head this will make him or her coil up and hide and stress the snake, make sure you are not attempting to stroke its head IMO
What does your petting consist of if you dont mind me asking ?
As Franky said some snakes have their own moods and disposition and even then it can change periodically , thats the beauty of interacting with snakes it can change from day to day and teaches you to read your animal and understand its behaviour.
alot of tanks you cannot help but come in from above but as has been said if you can come in from the side so as not to alarm it where possible.