It's true that genes play a role but it also works both ways.
All the female members of my family have a tendency to put weight on (apple figures) and it's only by being very careful with food that we can stay healthy. (My Gran had a heart attack at 60 and was overweight.)
'Blaming' your genes for either being slim (and able to eat anything and everything) or being overweight only goes so far.
We all have pre-dispositions to some things. But that doesn't equate to being unable to change our behaviour.
There's also more science now about how ultra processed food can cause weight gain even when calorie for calorie it's the same as non processed food. The worst of all are artificial sugars.
If I ate whatever I fancied, I'd be the size of a bus. I went through a fat phase just after puberty and hated it. I was simply eating too much.
At home, we don't have crisps, biscuits, cakes, puddings, sweets, sugary yoghurts etc. All our main meals are cooked from scratch.
We do have some 75-80% dark choc and DH and I have a square or two a day.
Now and again - at a weekend - I'll make a pudding.
Not posting this to be holier-than-thou but answering the OP.
And we're not 'posh'.