This is all based, most likely, on Griffiths' textbook. Quoting here from this post https://www.reddit.com/r/Physics/comments/1b97gt/magnetic_fields_do_no_work_but_magnetic_cranes/ :
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.
tl;dr: use Jackson ;)