I was watching a video of two transformers that had one end
milled away, such that each presented an E shape with coil in
the middle.
Energized in series N to S: They attracted, and stuck together.
Energized in series S to S, N to N: Unexpectedly did NOT repel!
The lesson is that N does not "attract" S, nor does S "repel" S.
Only the magnetic loops want to take the easiest path and will
attract or repel as necessary to achieve that end.
The E shaped core's loops were complete across the quarter inch
or so of the open ends. Pushing S against S, nothing about this
path length changed, and there was no useful force as a result.
In the N to S case, we could eliminate a quarter inch of gap by
drawing N faces to S faces, so a useful force was the result.
It could go the other way, depending the geometry, you could
have situation where repulsion is possible, but attraction is not.
Just need to free your mind from the everyday experience that
poles magically attract or repel. Its not so simple like that...