If I remember correctly, Truss was giving a keynote speech to some kind of business / trade group conference.
Presumably, her goal was to project British economic power abroad and reassure investors that Britain remains competitive on the global market. The way she chooses to convey that message is to use France as a convenient punching bag to contrast how well Britain is doing.
Of course, it's entirely possible Britain does indeed produce more variety of cheese than the French, but that's not what she's actually talking about. The British-cheese-variety is meant to symbolize the economic suprerioritysuperiority of the UK over France.
This kind of rhetoric is targeted specifically at a certain sector of the British population, who believe the UK is supreriorsuperior to France (whatever that may mean) and takes great pleasure in having that belief reaffirmed.
But to some people outside of UK, her cheese-variety remark naturally came off as petty, small-minded, and a bit dumb. Here is the Minister of Foreign Affairs of a former maritime empire (unironically) boasting about cheese suprerioritysuperiority with its European neighbour as if Brexit is still happening. Both the content and the delivery produced bad PR.
PS: It should be noted that Truss is known for being very bad at public speaking. She often comes off as wooden and doesn't know how to land the punchline. Which is to say perhaps another politician would have made the cheese remark actually funny.