The official routine/echo integration won’t work if the routine has anything other than light, switches and thermostats in it.
However, many of us have used routines with echo for a long time, before the routines were added as an official option. You just need to use a virtual switch. You have echo turn on the virtual switch, and you have the virtual switch run the routine. That way the routine can have anything you want in it, including locks.