^Fortunately, there are also a lot of statisticians and researchers running around

Well, not a lot, but enough to crunch these numbers. You're right, though, it's not as simple as that, but the policy efforts were informed by aggregated data and major research papers.
We can say with a high degree of confidence at the aggregated level if a group is being disadvantaged. As you can guess, they compare groups across a bag of metrics (education, work history, training, CV quality etc.), adjust that for local constraints (demographics and worker availability in the catchment area), etc., run the confidence levels, publish papers, receive critique, conduct confirmatory qualitative studies, etc. Then, they request public submissions, put the policy through a gradual legislative process, etc.
At least in the UK and Ireland it seems to have been handled sensibly.
The basic economics/demographics is managed by national stats bodies, and is actually quite standard work. Like most of things, the devil is in ensuring the policy is sensible; i.e., it gets the balance between applying adequate pressure without creating undue duress right.
And I do think that has happened in the UK and Ireland, the two policy settings with which I'm most familiar. Note, the only penalties are penalties for failing to report, while the data is already captured by firms in their payroll systems.
The part I like most about the policy is that it makes companies (over 250 employees) recognise the gap and explain plans to narrow it, much like public companies do for financial metrics in annual reports.
The new Irish policy is being phased in across orgs of progressively smaller size down to some minimum, so firms have plenty of time in advance to start thinking about how to get it right. Meanwhile, the government is trying to support the shift overall through adjacent policies such as better childcare support, etc.
Not everything done by governments is irrational; we just hear about the dumb things they do in the media every other day. These are, at least on the face of it, good policies. I'm sure they won't be perfect, but are pretty good. They also seem widely backed in by business.