Deferred only relates to the unlock command, see here for some more details.
Basically, the unlock does not happen immediately, it will be done at the end of the transaction. ideally, this is what you want, and as long as your transactions are quite quick, it won't be an issue.
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
One other thing to note is that you should not put any long running processes in %ZSTART as they will hold up the Start process.
If you have to, then consider JOBbing it off to a separate process, so it can run in the background and allow the rest of the startup steps to run in parallel.
For quick and dirty logging I use:
kill ^Log at the beginning of the ClassMethod/Routine
Then use the following in your code to track what is going on:
set ^Log($increment(^Log))="Your message goes here. For example VariableX="_VariableX
Run your REST API and then take a look at ^Log.
You can either put lots of "set ^Log..." statements in, or just a few to narrow down where the issue is and just keep adding them till you get to the code in question. This might take a few iterations, but it generally works for me.