What is your expected UX for a toggle with poor network reliability?
Broadly, these could be divided in implementations that offered a loading state (switch goes transparent until persisted, overlaid spinner etc.) and implementations that flicked the switch back when the request failed and provided a very noticeable status update (hint, animation, growl).
My preference for systems that work with unreliable persistence is the former, albeit that is purely personal and not founded in a deeper rationale.