Mostly a stereotype perpetuated by cheap or hastily found dining places.
When you get fish and chips from a good place that handles fresh catches, there is considerable flavour, yet buy from the fast food place in the middle of a high street and you’ll get a soggy representation from the frozen cod.
Same situation with a good roast, or a cottage/shepherds pie, or pie and mash that isn’t just a casserole with a hat, etc.
Honestly I’ve stepped foot in 39 US States so far, and it’s a similar thing there. I just think the “British food bad” thing has stuck as humour, there’s plenty of theories about it I won’t get into but it’s just a thing I suppose.
I find that hard to believe, since I would go to India sometimes twice per year when younger (for over a decade).
In 2005 we were told to be cautious of I think cabbage containing dishes, because it was making many people sick. It was also common for milk to be sold highly pasteurised and in blue bags within the city.
I’ve also had questionable and not good food from those little backstreet fast food places whether in Atlanta, Minnesota, Arkansas, and I even had a rather average Chinese dish from near Santa Monica (which I didn’t rate well).
There’s a good chance you were in the right area for good food, but that also exists here (example: Camden Town, which has been a ‘Foodie’ destination for a while now), or the plethora of food festivals all around London.
I apologise if I gave the impression that they’re hard to find: they’re really not.