maybe it's an unfair accusation. Just felt that way, given his best spells for us came when van Gaal and Solskjaer trusted him to be the main attacker while he did rather poorly under Mourinho. Either way, I hope he takes this chance and runs with it.
It's unfair because he didn't do poorly under Mourinho, in fact he repeatedly beat Rashford for the starting position. He won his place under Ole by outperforming Lukaku under Mourinho and then continued to outperform him when Mourinho left. Martial worst season is also the one where he begun the season as the undisputed starter, the following season is for me a question mark because Martial sustained a knee injury in March 2021 and it wouldn't be a surprise if he simply struggled to comeback from it.
Edit: I don't think unfair is the proper term though, because Martial has the habit of coasting when he is in a comfortable position.