A switch can either be an indicator (data sink) or a control (data source), but not both.
Of course you can use local variables to read from an indicator or write to a control programmatically. Is that what you are doing? There is always room for conflict and you should be careful when doing this, e.g. what should happen if the program writes one value and the operator writes a different value at the same time?
The statement "...getting problems" is too generic to make any suggestions. Do you have a broken run arrow? Do you get problems during running (unexpected results, unpredictable behavior, crash...)?
A code sample would make it much easier for us!
🙂