I ran into something similar not very long ago. Jeremy pointed me towards this warning swallower:
https://thebuildingcoder.typepad.com/blog/2018/09/swallowing-stairsautomation-warnings.html
ErrorHandling this way is much more versatile than the dialogboxshowingevent. You might want to check it out.
It took some time for me to get how it works, but it's really, really handy once you get it.