We tried TryHackMe as a supplement to our Security+ course material. The student's were not required to complete the exercises for a grade, but were encouraged. We found TryHackMe to be a bit difficult for beginners. I've heard the HackTheBox is even more difficult.
Our students managed to make it through a few of the TryHackMe exercises, but most just found the answers on "cheat sites" or YouTube videos. Basically, TryHackMe lacked actual instruction in most exercises - the students were just thrown "in the deep end" to capture the flag or whatever.
Now if we had a class on CYSA+ or Pentest+, this would be a better tool as a backup with classroom instructor-led lectures on the hacking methods, walk-throughs, demos, etc.