What you are trying to do would "break the laws of physics" if it worked.
You can't, so it doesn't.
As the system rotates there will be losses. Air drag and friction and more.
These losses absorb energy and cause things to slow down. For a system to rotate indefinitely it must get energy from somewhere. If there is no input energy it must make its own. A basic law of physics says that energy cannot be created. Millions of people have tried to do so. So far, all have failed and there is good reason to think that all will always do so - at least within the systems that we have access to.
George Box is known for his statement that "All models are wrong,. Some models are useful." Applying an imperfect but useful model to how magnets behave helps us to understand them better.
Most of the confused ideas about trying to achieve constant rotation and "free energy" from magnets comes from trying to visualise them as energy sources. The model of a magnet as an energy source in its own right is not only wrong but not at all useful.
An imperfect but better model is to consider magnets as if they interacted as "springs".
Here I'll use the concept of sprinfs pressing against and repelling each other. The concept of attraction can also be used but I'll not do so here.
With the spring model two magnets in proximity with the same polarity are like two compressed springs pressing against each other. If one is on a wheel (W1) and one is attached to a stationary surface(S1), if you turn the wheel slightly the two springs repel each other and the wheel turns. As the springs push the magnets apart energy is stored in the rotating wheel as it accelerates.
As the rotating magnet (W1) approaches a second stationary magnet (S2) the "springs" compress against each other.
If the second stationary magnet S2 is less strong (lower spring constant say) than was the first stationary magnet S1 then W1 may be able to close the gap so the magnets are opposite, slowing as it does as the "springs" compress without the wheel stopping fully, and then move past S2 and accelerate again. Similarly ot may encounter S3. I S3 is less strong than S1 it can again ":compress the spring", slow down, move up to and then past S3 and again accelerate. After one turn it again comes to S1.
Now we know that S2 is as strong as S1 :-)
When W1 comes towards S1 aand the "springs" compress the amount of force that W1 is able to exert, and the energy stored in the wheel, can at best be the same as when it started. If there have been ANY losses it will not be able to get all the way back to the start. In a truly lossless system it would JUST get back to the start.
If it was given some external spin initially it may be able to pass S1 as the extra energy to do so was imparted externally.
If you observed this system you would see a wheel rotating and deceleating as magnets came into proximity and then accelerating as they passed each other. It may LOOK as if the system was operating as a motor.
However, you would really be seeing the "spring model" above, and in due course the losses would cause it to stop.
You can find MANY device on the internet that appear to work using magnets and rotation and not to ever stop. Every one, every single one, is a fake.
Many years ago I saw a demonstration of a system that was made with ball bearings and a circular tilted track - ball bearings APPEARED to run around the track forever without external energy input. It was something like the ball bearing analogy of the above spring model. What they did was to very slowly revolve the whole track with a hidden motor to make up for the losses. It was very good and very convincing. But, still a fake.