You are casting your pawn into a switch, which it is not, so the cast fails. If the switch is an actor in the world you should have a reference to it somehow, and store it in a variable in the MySwitch type (or just use it).
You should first get the reference to the switch actor somehow.
After doing that you can just use it.