Conjunction and malfunction: that was the story of my travels this week. I first visited Seville and caught a night train to Barcelona soon after the reign of an old dictator had ended. And this week, I found myself stepping aboard an overnight train from Seville to Barcelona on the day another geriatric generalissimo relinquished his regime.

The first totalitarian was the fascist Franco, who finally did the decent thing in 1975 and died, meaning I could at last go to Spain. My overnight journey from Andalucia to Catalonia comprised 16 hours of hell.

In 2008, as the news arrived from Havana that Fidel Castro was hanging up his revolutionary fatigues, I was booked on the same trip – but with maximum luxury. This time, the journey comprised four hours of heaven, followed by 16 hours of hell.

Serves me right for getting ideas above my station. When I booked a ticket on Spain's longest-distance train, I chose to upgrade to Gran Clase for the full "Trenhotel" experience: "guaranteeing the maximum comfort", promises the train operator, RENFE.

On the face of it, a single compartment in Gran Clase is one of the greatest bargains of Western European travel. For €93 (£72) you get transported from one end of Spain to the other. And you also get a heavenly mobile hotel room.

On Tuesday night, I needed all the comfort I could get. For once, instead of merely pretending to work, I had to do something useful: predicting the effects of Fidel Castro's passing on Cuba and the rest of the Caribbean. At the end of a tough old day, I walked over from the tangle of ancient lanes of central Seville to the 21st-century temple to the train known as Santa Justa station.

The attendant showed me to a cabin complete with en-suite bathroom full of freebies: sewing kit, toothbrush, shampoo for the built-in shower, plus pairs of both slippers and earplugs and a bar of chocolate on the pillow. Unlike the old Catalonian "express" three decades earlier, there was no need to colonise a patch of the compartment floor and shoo away intruders.

The motion of the train lulled me to sleep in seconds. But at 1am I woke because someone was hammering on the door.

The attendant explained that the line ahead was blocked by a broken-down freight train. I was instructed to dress and pack, then get off the train and on to a bus. From sweet mobile dreams to a transportational nightmare in seconds. The last time I abandoned an overnight train I happened to have been in Cuba, when a locomotive even older than Fidel spluttered to a standstill at dawn some way from Havana. I let myself out and walked across fields that – like most of Cuba – lay fallow. I found a road. The first car I flagged down magically transformed itself to an airport limousine with the aid of a $10 bill.

Back to the present. Now, while I applaud the organisational abilities of anyone who, in the middle of nowhere in the middle of the night can conjure up a coach and a couple of drivers prepared to tackle a 13-hour road journey, it sounded a horrendous prospect.

"Can't I just stay here until the morning?" They agreed; I went back to bed. I was still mentally trying to re-adjust the next day's schedule when the hammering started again.

A change of plan. The "bus refuseniks" (four of us) would go by taxi to a hotel 30 miles away in Córdoba.

Only at the hotel reception did it transpire that Spanish Railways would not be paying. By now it was 3.30am. In the past six hours I had travelled 80 miles from Seville. So I handed over a card in return for what would be the most expensive sleep of my life – costing a penny a second. Before I retired for what remained of the night, though, the receptionist pointed out that the contents of the minibar in rooms at the AC Hotel in Córdoba are complimentary.

I soon found out why: the most interesting item among a dismal lot was a bottle of San Miguel "0.0" alcohol-free beer. Cheers.

I awoke at 7am, paid the €130 (£100) bill and headed for the ticket desk at Córdoba railway station to join the other exhausted passengers who found themselves aggrieved in Andalucia instead of sipping coffee in Catalonia. Surely, I argued to an official, since Spanish Railways had promised transport and sleep but failed to deliver either, it should pay the hotel bill? The shrug transmitted such disdain that for a moment I imagined I was dealing with an intransigent railway official in Russia, not Spain. With reluctance, he agreed that I had a moral right to a train to Barcelona. But not in Gran Clase, señor: you'll have to slum it in second.

To summarise: first, the luxurious "train hotel" stopped being a train. Then it stopped being a hotel. And when, finally, I was able to continue my rail journey by way of Madrid and Zaragoza, I was downgraded to the class known disparagingly as turista.

I arrived in Barcelona seven hours late and £100 out of pocket. On the final stretch, the woman next to me was reading a novel called El Viaje al Amor, The Journey to Love.

Mine, I reflected, had not proved a journey to love. That other old dictator, and noted exponent of punctual trains, Benito Mussolini, would have appreciated the irony.