The Spanish supreme court imposed long sentences – nine to 13 years in prison – on nine leaders of the Catalan independence movement last Monday. The leaders were convicted on charges including sedition and misuse of public funds. They had organised a banned self-determination referendum in October 2017, followed by the abortive declaration of an independent republic.

Significantly, they were absolved of the crime of “rebellion”, because the judges acknowledged that such minor violence as occurred was not part of their plan. And, rather bizarrely, the sentence also argues that they did not actually intend to secede from Spain, but were simply trying to strengthen their negotiating position with Madrid through their high-profile actions.

The Spanish government will struggle to persuade its EU partners to whole-heartedly endorse such a contentious judicial process. Inevitably, the verdict has been greeted with anger and mass demonstrations on the streets of Catalonia.

Yet much mainstream Spanish public opinion sees the verdict and sentence as fully justified; indeed, some resurgent Spanish nationalists think the judges were too lenient. This reflects the deep divisions provoked by almost any discussion of the Catalan question over the last decade. On both sides, irresponsible opportunism, and a blinkered refusal to engage with differing viewpoints, have repeatedly marked the deterioration of the once-healthy relationship between Madrid and Catalan nationalism. Bridging this chasm should be the priority of all democratic Spanish and Catalan politicians. Instead, their comments on the verdict are likely to be little more than dog-whistles to their own bases, as the country gears up for yet another election next month.

The caretaker Socialist Party (PSOE) prime minister, Pedro Sánchez, once appeared to be a voice for at least tentative dialogue and reconciliation. But as Spain’s conservatives have moved ever further towards ultra-nationalist positions, he has aligned himself with their rigid discourse, denying the complexity of the issues. Only the leftist Podemos has argued consistently for a middle way, respecting Catalan nationalist aspirations while defending the project of a unitary, if much more federal, Spain. But this party is now increasingly marginalised and fragmented.

This trial and its verdict represents, above all else, a failure of politics. Obstinate refusal by Madrid politicians to engage with legitimate Catalan nationalist concerns generated an equally bone-headed and democratically dubious fantasy project by Catalan leaders.

Passing the buck to the judiciary has not erased the challenge facing Madrid from Barcelona, nor will street-fighting make Catalonia a better place to live. Everyone needs to go back to the drawing board.