Sounds like the prosecution screwed up by not petitioning to have him committed prior to his release from prison. Bet they won't make that mistake again any time soon.
I agree the prosecutor screwed up, but the real problem lies with the legislators who wrote this law. It requires that the offender be convicted of sexual violence, has a mental abnormality that results in difficulty controlling his sexual behavior, and be likely to commit more violent sex crimes if not confined. They then add on the requirement of a recent overt act. Why? Shouldn't it be enough that he's likely to commit more violent sex acts. It's kind of like one dog bite for free.