At https://service.mendixcloud.com/p/OQL (using OQL-version 2.6, hm should upgrade this to 2.10)
FROM Sales.Customer AS c
GROUP BY DATEPART(WEEKDAY,Birthday)
SELECT DATEPART(WEEKDAY,Birthday) AS BirthWeekday_Sundayis1,
count(*) as NumOfPersons
ORDER BY BirthWeekday_Sundayis1 ASC
works fine, which seems similar to your query.
Maybe during upgrade from 9.6.12 to 9.6.15 you also upgraded an OQL-version. And now you stumble upon a bug of the OQL-module, that was not in your previous OQL-version. What version are you using: