Some schools that come out on top of exam-performance league tables are actually failing some of their pupils, MSPs on the Parliament's education and culture committee were told this week.
Success is being judged according to the number of high-achieving pupils likely to go to university - but the "perverse" use of such data leads to accolades being given to headteachers and schools where it is not due, while many outstanding heads' work goes unnoticed, said Craig Munro, of the Association of Directors of Education in Scotland.
"We have schools in the top 50 of The Sunday Times league table system that are failing children," said Mr Munro, chairman of the ADES performance and improvement network.
Even the top-ranked school might have "lost sight" of pupils whose achievement was at the bottom end, he added.
The crude use of data also ensured that some schools doing excellent work with lower-achieving pupils did not always get the recognition they deserved.
This "perverse system" allowed schools to "increase the attainment gap", and led to "great accolades" where they were not necessarily merited.
"Many very, very effective headteachers have been overlooked, and have suffered bad morale as a result," said Mr Munro.
Some schools were good at analysing "richer data". But, he added: "I don't think we have a consistent approach across Scotland."
There were, however, positive noises coming from the Scottish government about taking more sophisticated approaches to data in determining how well schools were doing, Mr Munro acknowledged.
The committee also heard that the regular and blithe admission of television personalities that they are useless with numbers was a sign that poor maths skills had become culturally acceptable.
"It's quite fashionable to say you're not good at maths," said Moira Finlayson, honorary research fellow with STEM-ED (a partnership which champions science, technology, engineering and maths) at the University of Glasgow.
The attitude that "it's almost a virtue" had crept into schools, she argued, but it was not acceptable for teachers to protest their ignorance and do nothing about it.
"If teachers aren't confident at teaching maths, they can learn," she said.
Teachers and headteachers should be given five-year fixed-term contracts to encourage their professional development and drive up attainment, retired headteacher Brian McAlinden told the education and culture committee.
"I think teachers should have a fixed-term contract -it's not popular, I usually have to duck when I say it - including headteachers, because the big incentive is if you know you're coming to the end of your five-year stint and you're coming up for re-election, you make sure your CPD (continuing professional development) is up to date," said the former head of Glasgow's Castlemilk High, who served on the government's raising attainment group of current and ex-heads.
If Scottish education were to undergo "transformational change", radical steps such as this might be necessary, he said.
"I don't understand the mentality," said Neil Findlay, a Labour MSP for the Lothians and former teacher. "Surely people are most confident and will put more into their school if they know they are going to be there for a substantial time."
ADES general secretary John Stodter, speaking in a personal capacity, told TESS that while he would not support five-year contracts for teachers, it was an idea that might have merit for heads, allowing local authorities to move them to where they were most needed.