That error means that you sent a string to your callback, rather than a view.
I'd bet when you were calling
switch_1('switch1') instead of switch_1(v['switch_1']).

It is usually helpful to look at, and paste the full traceback, to see where errors occured.
If the ui debugger pops up, you can actually look at the variables at each level of scope, and see where the problem happened, and can walk up the call chain to see where things were called. Pressing Print Traceback prints a full traceback, which is what you should always include whenever you are asking for help on the forum.

Learning to debug is a important skill, since it means you will be able to diagnose most problems without the delay of forum posting back and forth. (Thats why i was trying to ask leasing questions, rather than post a solution). If I can offer a few suggestions for effective debugging:

First, find out what line threw the exception. That's key, since if you don't know where the error is, how can you fix it. Printing the traceback will tell you this, and the sequence of function calls that got you to that point.

Next, make sure you understand what the error is telling you. AttributeErrors mean you tried to access an attribute that doesn't exist. Usually that means the object you have is not the one you expected -- for instance, when switch_1 is called with a string, instead of as ui.Switch.

Often the pythonista debugger will then let you walk up and down the stack, and examine variables in simple structures. Expand the window, then click on variables tto examine variable values. The switch to the stack view, and you can swicth to the callers scope, and look at variables in that scope, etc. The pythonista debugger is somewhat limited (cannot evaluate arbitrary expressions), but is easy to use and for every one of your problems here would have provided good insight.

As a crude, but easy and effective debugging technique, add print statements at key places in the code before your error. For instance, if you had print(fmt) in your old code, you would have noticed that you were being sent a ui.Switch, and not a boolean or string. If you are getting an AttributeError on somevariable, print(somevariable), print(type(somevariable)), and print(dir(somevariable)) can help you understand what you are dealing with.

Eventually, you will want to learn how to use pdb.pm() for debugging problems after the fact, or pdb.settrace() for setting breakpoints. This is a slightly more advanced topic, but only sort of -- when I was learning python, after the basics, one of the first things i taught myself was the debugger!