Most of these tests are not actually for setting purposes. They are effectively IQ tests and are used to assess potential, not what children know. They are used as baseline data...measuring the starting point. The computer programmes then predict outcomes at GCSE (which the children are never told.....because they are just a prediction, not a certainty...and like you say, it doesn't help for children to feel limited in what they can achieve). However they are useful for flagging up when children are under performing. If data suggests they should be on line for a B, but are working at D level, the teachers can look into why this is and take steps to help.
These kind of tests don't test what you know. You can't really prepare for them. The children won't know the results. They are done so early to just get them out of the way. Leaving them until a few weeks later, or warning children they were coming up, would generate more stress and people trying to prepare for them.
Teachers form their impressions of children from a variety of information. Many will come with SATs results, they might do these IQ type tests, teachers will watch children in class and look at their written work. The full picture does take a while to emerge and teachers know that. It is why many schools don't set at all in the first term or year. However, the more information that can be gathered, the better the overall picture and the less one individual off-day in a test, in class or in homework matters, because teachers really do look at the overall picture.
And regarding those tests, teachers know that although they are pretty accurate when looking at the statistical outcomes of large samples of pupils,they are not accurate for everyone. So it becomes known that X is actually much better than their baseline test suggests, or X perhaps over performed in the test,mbut has never then worked at that level.
Most children do the tests in a low key environment, with little warning, so no time to be stressed. It is over quickly and onto something else. And with these baseline tests, they never hear about them again. I think it is parents who are stressed by the idea, not the kids tbh.
Of course there maybe other tests too which do test knowledge, but they do tend to come later. When faced with possibly 200 students that are all new, there have to be ways to get a quick sense of where they are starting from. But again, teachers understand that people do t always perform well and children are not pigeon holed as able or limited for evermore. Have a bit of faith in the fact they are professionals.