However, I would also very much appreciate knowing whether a company has such policies as early in the hiring process as possible.
Depends on the context. For example, if your user base is diverse, it can be larger than if it wasn't - the total potential market is larger. So, diversity is profitable in that context.
Serving a diverse user base well is potentially easier with diverse staff. Remember those "Falsehoods programmers believe about X" articles? With a diverse team, chances are higher that those falsehoods are caught early, because the team covers a broader range of life experiences. So, diversity is good in that context.
How much of an impact this argument has depends on the concrete role, of course. My work tends to be very low on the overall software stack, and the notion that diversity helps seems very weak there. At the very least, I expect that diversity of thought or actual neurodiversity matters more than ethnic or gender diversity.
I think your second point is completely valid. Having a greater diversity of skills, perspectives, experience, ideas... on a team seems to be obviously beneficial. But that’s not at all relevant to the types of diversity HR programs aim to implement. Those programs are generally concerned with factors like ethnicity, gender, and sexuality... which are not at all related to the factors you mentioned.
The interview questions like this are usually designed to eliminate neurodiversity. I mean, how many people on autistic spectrum could successfully navigate them without triggering at least one "red flag"?
(When even things like "correctly answers part of the question, forgets there was a second part" are considered red flags.)
The set of categories that diversity advocates typically care about is itself not diverse.
But both those phrases are strong tribal markers.