and call switch_model inside the callback function, which produced the warning: Calling st.rerun() within a callback is a no-op.
Anyway to overcome this?
As the error suggests, any function assigned to a callback cannot contain a rerun command. Callbacks are something that occur at the beginning of a page rerun. What is contained within your callback function?
The recommendation would be to rework the callback so that it does not contain a callback. It would help to have a minimal, reproducible, executable snippet to understand what is happening.