Spawn function fail conditions

The description of the Spawn function says “Tries to spawn a guard”.

Does anyone know how/why it could fail? What are the conditions?

It fails quite often and I spent to much time trying to understand why. I need some help.