When one of Sweden's largest chains of independent, state-funded free schools announced that it was closing down at the end of last month, it managed to upset just about everyone.
Principals working for JB Education were furious to receive only a few days' notice; the group's 10,000 students read about the move in newspapers before they were officially informed; and prospective new operators for the schools were angry that deals were being made public while they were still under negotiation.
The education business, which was owned by Axcel, a Danish private equity firm, was forced to close after suffering heavy financial losses.
Although individual free schools have closed down since Sweden pioneered the concept of handing control of schools to businesses and charities back in the 1990s, this is the first time that one of the country's major chains has gone under. And although all the students and most of the teachers will probably find themselves at a new school after the summer, confusion and uncertainty still reign.
Many critics have seized on the failure of JB Education as proof that the privatisation of state education will lead to exactly these kinds of situations: profitability put before duty of care to students and teachers. Independent chains are running increasing numbers of schools in countries including the UK and the US.
But Anders Hultin, chief executive of JB Education, who spent five years establishing the UK arm of Kunskapsskolan, another Swedish chain, said that bankruptcy shows that the system is working. "From a general perspective, I think that this is what the system is about," he said. "The alternative would be for bad schools to be protected in some way and not to do anything about their problems, and that would be very, very difficult for students."
Mr Hultin, a long-term advocate of profit-making companies being allowed to establish and run schools, was appointed chief executive of JB Education only nine months ago. "I was told that it was a turnaround job but I realised by the end of last year that a turnaround was not possible," he said.
The crunch came in March, when he learned that the company would enrol only 1,700 new students this autumn when it needed 2,800 to break even.
"We realised then that the gap between what we hoped for and what we actually got was too big to be overcome, so from that point I've been dealing only with finding new homes and harbours for the schools. Given the circumstances, I think we have been quite successful."
Four of the group's 30 upper secondary schools (for students aged 16-19) will be shut down, one has been bought by its principal and the rest have been passed on to a number of other chains. Four will be run by Fria Laroverken, a new company set up by Mr Hultin.
JB Education is unlikely be the last casualty of a demographic slump that means roughly 30 per cent less students will be at secondary school level this autumn than in 2011. Student numbers are not expected to return to 2011 levels until 2020.
The company's reputation had struggled to recover from a damning 2007 investigation by Sweden's TV4 channel, which revealed how its founder had become a millionaire despite the schools' many shortcomings. Then, in June last year, Sweden's schools inspectorate issued a highly critical report of the group, putting nine of its schools under supervision.
"Free schools are losing a bigger amount of the students than the municipal schools because, in Sweden, the school debate in the past three years has been very negative to the free schools," said Marika Markovits, director of Stockholms Stadsmission, a charitable foundation that is taking over six of JB Education's schools.
Ms Markovits expects non-profit operators such as hers to increase their share in the wake of JB Education's demise. But she is unhappy about how the company handled the deal with her foundation, claiming that it announced the takeover four days before her board met to make a decision.
Teachers are also unsure what to expect. Andrea Martensson, a social science teacher at JB Akersberga, near Stockholm, faces a big drop in salary. She has been offered 60 per cent of her previous hours at neighbouring school Skargardsgymnasiet, and is trying to make up the rest at other schools.
"At least it's a job," she said. "And in a couple of years there will be more students, and more teachers will retire, and then the problem will be over."
Anders Lundin, principal of Skargardsgymnasiet, whose school is supposed to be taking on up to 75 of JB Akersberga's students next term, said that he still needs approval from Sweden's schools inspectorate before he can start offering the catering and car repair programmes that JB Education used to run.
"Nothing is clear, so we're in a vacuum right now," he said. "They said that we would take their students but we don't even have permission to run all the programmes they have. They've promised something that they don't know they can provide."
Mr Hultin conceded that the closure could have been handled better. "Of course we would have preferred to make an announcement to our students and employees first, and not to have them reading about it in the newspapers, but we had no choice," he said.
To head off scare stories about stranded students, he decided to announce the new owners he had lined up. "I thought we had agreements with everyone. Whether or not every single paper was signed I don't know, really," he said.
Anita Kettunen, principal of JB Akersberga, defended the work done by Axcel since it bought the chain in 2008, regardless of the ultimate outcome.
She has now lined up a job leading a municipal school but has not lost faith in Sweden's free-school system. She argued that those who worry about the money private operators take as profit should be just as concerned about the cash wasted by inefficient municipal schools.
"The number of schools (that closed down) took everyone by surprise, but if you're going to have a system where you have a market, you have to be ready for this," she said. "I don't think there's any system that could manage this better."