AFAICT this is not a bug and Beaker has dealt with an job submission script gone awry (by the locks of it) exactly as it was supposed to, and that is to catch these types of invalid state transitions.
(In reply to Raymond Mancy from comment #2) Hmm, the problem is why lock doesn't work, this thing should not happen. I assume some thing didn't protected correctly, although the program can handle the exception.