It does.
One example of this is quite simple, but demonstrates how the instinct to repeat the habit activates even in irrational situations:
I was quite paranoid of forgetting my keys and not being able to get back into my apartment again, so i made myself physically touch my keys before closing the front door every single time i left my apartment. Some years ago our apartment complex installed us new doors, and for like a day the doors were installed, but none had any locks in them.
As i was leaving my apartment, i still had to touch my keys before closing the door, eventhough the doors had no locks in them.
Another time i went out to take out the trashbag into the trashbin, while i had a friend inside my apartment. At the door i realized that i didn't have my keys so i couldn't touch them before closing the door, and i couldn't be arsed to go find them, as i could just leave the door open or ring the door bell to get back in.
But because of my self-conditioning the whole way to the trashbin felt the same like i had left the stove on, and i had this feeling of absolute dread of getting locked out of my apartment.