David Epstein calls this "desirable difficulty" in the book Range.
Interestingly he recently discussed how using LLMs tends to remove this desirable difficulty: https://davidepstein.substack.com/p/a-risk-of-cognitive-conv...
This means that the results (both of the task and of the learning by the student) are lower if the student uses an LLM first, but slightly improves if they use it second