You realise you can eat anything and lose weight? No, genuinely. What happens is that people take this advice and forget obvious points. Let's say you had 1800 calories, for instance, of pizza - you'd lose weight (assuming it was in a deficit). But the issue is satiety. You can have that pizza, but you'd feel 'hungry' later on. So, what happens? You keep eating to feel full, but then you severely overeat on calories and you're left scratching your head.
The solution? Have foods that satiate you, however don't ignore other foods because you think they're 'bad' or will make you 'fat'. I'd say to stay consistent to this rule you should have one cheat meal, not day, a week or something. It just keeps you focused.