Yes, you can force that with magnets designed for that, but these appear not to be magnetised like that, so if you want to avoid the rotation, you need to do something about it.
As I say in my other comment, easy enough to do with non-symmetrical mating surfaces.
As I say in my other comment, easy enough to do with non-symmetrical mating surfaces.