In the following script, if you toggle Switch, all is fine. When you toggle Switch2 and it sets the parameter Switch it causes a crash.
function onSwitch()
local message = {}
message.type = MessageBoxType.information
message.text = 'Message Box Text'
messageBox(message)
end
function onSwitch2()
this:setParameter('Switch', not Switch)
end
defineParameter('Switch', nil, false, onSwitch)
defineParameter('Switch2', nil, false, onSwitch2)