Toggle variant works as a basic component when connected to a frame

When I don’t connect the toggle itself to a page with the toggled button and its outcome, the button works as intended(the button does a stretch motion before reaching to the other side). But when I have it connected to each others frame, they don’t work the way they’re supposed to.