I was not doubting that you were seeing what you were seeing, just that the script was not doing that so something else must be happening.
I see what's going on. You are applying the EffectDazed with DURATION_TYPE_INSTANT. There seems to be an engine bug when you do that. The effect it not removable at all. Resting does not clear it either.
You are not supposed to use INSTANT for this type of effect only TEMPORARY or PERMANENT.
Others may be able to comment on whether that bug is known or not. The Lexicon says " This effect cannot be applied instantly, only temporarily or permanently." But that does not seem to be accurate since the effect is clearly applied. Maybe we need different wording there.
Edit : That listing was the actual code the script compiles to... the byte code read by the machine that executes scripts in the engine, not a log or transcipt of a test execution, but it shows the exact steps the execution of the script would entail.
fwiw means "for what it's worth" '>