Automation inconsistent

Automation is very inconsistent, sometimes goodnight locks the door (schlage lock), sometimes it doesn’t. Any solutions?