Not an "unlimited amount of space" no! But this is exactly what happens any number of times a game! If someone is dribbling with the ball, then if you can't get in front of them, you have to hang back and wait your moment. If you try and get in front of them and fail, then you risk giving away a foul.
As for "randomly stick a leg out" - I think that if you slow down every incident where someone use their legs to shield the ball, you will see very similar actions. It's an integral part of football that you're allowed to use your legs, and the rest of your body, to protect the ball when you're in possession.
I understand that there might be a threshold issue for some people, but that's a separate discussion. Most people don't even understand that there is a higher threshold for a penalty than a FK—not least as it's not in the Laws of the Game. Regardless, the decision was given onfield in this instance, and it's seems entirely crazy to me that decision was deemed a "clear and obvious error".