I read on Twitter that non-traditional students (who obtain a PhD in their early forties or later) have less academic job prospects. Is that true? Asking for myself.
You give a very wide definition of "non-traditional". That complicates any answer, since every specific group will have its own issues. But for many such groups the problem will be obtaining the degree and having a career supporting advisor to help get them started, not the situation they are in.
At the moment jobs in academia (especially) are difficult to obtain in many places and some fields. That can change. An older person with a new PhD might have an advantage in some places and a disadvantage in others as the needs of different institutions are not the same. Being more mature can be an advantage, for example and life experience, itself, also.
While most folks start an academic career at around 30 or so, quite a lot later isn't necessarily limiting. Getting into a program can be difficult if you have lost contact with people who can predict your research (etc.) success.
But, in some ways it is immaterial. If you are already a 40 year old woman with two kids who wants to be an academic mathematician, changing your history isn't an option. You will need some support from various people to get in to a program and to maintain focus in the program, but if you can graduate with good research and a good and supportive advisor then you have a chance for success. (Basing the above on a real case).
In some places discrimination might be illegal, and in academia many people would disapprove of such things, though it can exist.
But, if you have a goal, then do what you need to do to achieve it. There is little worse than wasting your only life doing things that are sub-optimal by your own standards. And, there is more to life than a job in any case.
And, twitter probably isn't the best source of reliable information.