Could be a couple of reasons. Since you’re saying that the routines work on a manual unlock but not with a keypad then it’s likely the app which stopped working after an update from SmartThings earlier this year. Smartthings has made many changes to the platform and frameworks (and continues to do so to fix issues and add new features) which requires apps and device handlers to be kept updated to continue to work.
If you have access to rboy apps, you may want to check out this app which is updated regularly and works pretty well for creating custom actions including executing routines like you’re doing: