As for your specific hypothetical, it still seems to be contrary to the stated goals. My guess is you'd want to cast your net wide to get a cross-section of qualified candidates and maybe not just hire from the same sources that produce homogenous candidates
I mean, horribly incompetent.
Like, what'd you do? Post your job ad in the mens room of a cracker barrel in rural Arkansas? How'd you manage it?!
Yet the pool of US-based applicants was anything but diverse. Very few women and almost zero URM (Under-represented minorities). Also the candidate diversity was worse for more senior levels.
Also it is very important to respect privacy. Many people have a family, that does not know about their secret gender identity or secret sexual orientation!
Unless things have drastically changed recently, I have no idea how normal companies can find black programmers. As I understand it, the FAANGs are able to hoover up a lot of the diversity to meet their DEI goals, because they can outbid everyone else.