it’s harder to see what’s going on (not that it should happen but rotation and keeping ‘up’ straight is tough in any program) if you construct it as you did – putting the rectangle in the orientation it ‘should be’ in before sweeping.
This has two rings – one built like yours but with the rectangle in the ‘normal orientation. Toggle banking on and off in that one and you will see what’s going on. I don’t know how to stop that but the other one is another way to do it – with Rail Scale.