This is all based, most likely, on Griffiths’ textbook. Quoting here from this post reddit.com/…/magnetic_fields_do_no_work_but_magne… :
The statement “magnetic fields do no work” is incorrect. Griffiths has mislead a generation of physics students on this. A correct version of the statement is that “magnetic fields do no work on objects with no magnetic moments” which is rather trivial. One could also correctly make the same statement about electric fields. However, electric monopoles are very common, so a situation in which there are no electric moments never occurs in normal circumstances.
mmddmm@lemm.ee 2 weeks ago
Thanks.
Somehow an entire generation of teachers just decided that magnets don’t attract or repel each other.
Those blatantly wrong things that somehow people still insist on teaching are ridiculous.