It's nothing to do with space, as you've just described he's got all of the technical ability to operate in small spaces.
Mahrez's problems are all mental and have been since the day he arrived at the club. This was his big pay day, he went from Ligue 2 in 2014 to signing a £55m guaranteed contract in 2018 and it completely killed whatever drive he had before.
All of his issues are to do with attitude. He doesn't work very hard, he is greedy, he's too casual, he just doesn't care most of the time. When he does show up with the right mindset, he can be brilliant, but it's rare.
Honestly if there was any game where you could guarantee Mahrez would not want to be there and put in a shit performance, playing away to a League 2 team in the FA Cup with half the team rested is it, and I don't know why the management didn't recognise that - maybe they don't care and just needed to rest Bernardo more than they needed a good performance at RW.