Gordon Ramsay and I eyeball one another, turn away, and stare into space. In the long, sour silence that follows, I hear my nails drum the notepad on my knee. "Well," I say, "maybe we should call it a day."

"I'm going to shoot, then," huffs Ramsay. "I didn't expect it to end like that."

"Well, neither did I."

And without another word, we both walk out.

Did that really just happen? Did the man who once yelled at Edwina Currie on camera, "One minute you are shagging the prime minister, now you're trying to shag me from behind", just get upset with me for being "too personal"? Apparently so. I hadn't thought it possible to fall out badly enough actually to abandon an interview, until now. Then again, I've never been so glad to see the back of an interviewee.

To be fair, I've no idea if Ramsay is always like this. One of the PRs who rings me later promises he isn't. He'd been injured in a charity football match the previous day, so hadn't had much sleep, was pumped full of painkillers and still hobbling in agony, so maybe I did just get him on a bad day. Even if I didn't, and this is the real Ramsay, his new show is still an interesting idea.

Gordon Ramsay Behind Bars takes the chef into Brixton prison, where he sets up a kitchen – Bad Boys' Bakery – and teaches 12 inmates to cook. You can't begin to imagine the logistical nightmare of filming a cookery show inside a jail: every potato peeler, let alone every knife, presented its own security challenge, while any of the cast could be shipped out, released or removed from the project at a moment's notice. Prison staff were worried, one officer told me, about Ramsay shouting and swearing at men who have "impulse control issues", and the governor had to give him "a very strict talking to about boundaries".

The prison eventually called a halt to Ramsay's visits to the wings, on account of the disruption. But 11 branches of Caffè Nero in London now stock Bad Boys' Bakery's cakes and wraps, and if all goes well the kitchen will be financially viable and continue to operate long after the show has aired. I met some of the inmates, one of whom had never cooked so much as "a bowl of cereal" until he met Ramsay, and their enthusiasm was both palpable and touching. This is reality TV with a conscience, more concerned with rehabilitation than fine dining, and in that respect feels closer to Jamie Oliver territory than the usual Ramsay TV fare. The project's purpose is both impressive and quite simple – to give repeat offenders an employable skill they can use on the outside, to keep them from winding up inside yet again.

Given all that has happened to Ramsay himself of late, the series could also be seen as an exercise in his own reputation rehabilitation. First came allegations in 2008 of a seven-year affair, which he denied; then came revelations of massive losses, forcing the closure of several restaurants worldwide; then there was the suicide of a former contestant on the American version of Ramsay's Kitchen Nightmares TV show, and the very public falling out with one of his famous proteges, the chef Marcus Wareing, who declared, "If I never speak to that guy again in my life, it wouldn't bother me one bit."

We're accustomed by now to the soap opera quality of many celebrity chefs' lives, but Ramsay's became more Jackie Collins than Coronation Street late in 2010 when he sacked his own father-in-law. Chris Hutcheson wasn't just the company CEO; he was Ramsay's closest friend and confidante. The pair were, Ramsay once said, "Two wings of the same plane", while Hutcheson has said, "This marriage of Gordon and Tana was a marriage of three. We were a package." Now they were a war zone.

Ramsay hired private detectives to spy on Hutcheson, and accused him of siphoning off £1.4m of company money to fund a secret second family and multiple mistresses, and to maintain his high-rolling, philanderer lifestyle, which his father-in-law denied. Hutcheson responded by telling a newspaper that Ramsay was a "very strange character" who'd become a celebrity-obsessed "monster", and warned of knowing "where Gordon's bodies are buried". Hutcheson hacked into Ramsay's private emails, which ended up in the Daily Mail.

On Ramsay's 45th birthday, Hutcheson's wife wrote to her daughter, "Tana, you are not welcome anywhere near our door. I cannot believe that you have done this to your father. Until you dispose of that man, you are not welcome back." Ramsay promptly wrote back, calling his father-in-law a manipulative and controlling "dictator" – but instead of posting the letter, he published it in a newspaper. Law suits flew between all parties until finally, in February this year, a legal settlement was reached, in which Ramsay paid Hutcheson £2m and severed all professional links.

‘I look at what I’ve gone through with my family, and you just think, Christ, thank goodness you keep a level head.’ Photograph: Jay Brooks for the Guardian

Emerging from the wreckage of a drama that has cost him, according to company accounts just published, some £6m, Ramsay issued a press statement last week claiming, "Our performance in 2012 is shaping up to be one of our best to date" – but that's not how everyone sees it. In the words of one restaurant critic, Ramsay's culinary reputation is in "slow-motion decline", the victim of "a morality tale of the perils of greed and egomania".

Ramsay certainly begins the interview in the manner of a man working hard to come across well. He talks indulgently about his children's pets – fish called Ant and Dec, numerous cats and dogs, the corn snake his son wants. Will Ramsay put his foot down about that one? "Not a chance – I'm not that controlling." Tana is the firm one, he laughs, but then again, he's very keen on discipline, and is pleased to see the older ones getting Saturday jobs. They fly economy, even though airlines always offer to upgrade them, and wouldn't dream of complaining about it, he says. Megan, 14, and the twins, Jack and Holly, 12, were conceived by IVF – "which was humiliating, embarrassing, and very emotional. Because when it doesn't work, then you start questioning yourself, and then you stop going to parks, you stop going away on family-oriented weekends, and you just, well, you put that pressure on yourself." So the first three were "a dream", and the fourth, Matilda, 10, a joyful surprise.

I'm always interested in men who have big families without seeming too keen on hands-on parenting. Ramsay wrote in his autobiography that "just about everyone in Britain" knows he has never "changed a nappy", confirmed by his wife in an interview – "It's true he's never changed a nappy" – so I ask how domestically involved he likes to be. Here comes the first roll of the eyes.

"Of course I've changed nappies," he sighs irritably. "But, you know, you make these stupid, throwaway comments. It's just a very messy, awkward thing that I'd spend eight or nine minutes doing, when Tana can do it in 90 seconds. So Jack will forgive me on his 18th birthday for not making a hash of wiping his arse from zero to three."

Then, apropos of nothing, he volunteers, "I mean, families are weird. We've come into a very strange predicament – it's not all sweet and lovey-dovey, there's issues – and so I look at the last 18 months, two years, and I think of what I've gone through with my personal family, and you just think, Christ, you know, thank goodness you keep a level head."

At this point, one of the women he's brought along with him, who is never introduced, leans in and lays a hand on his arm. "OK," she says crisply, "it's back to prisons. Let's get back to prisons."

Ramsay set up a kitchen at Brixton prison for his latest TV show. Photograph: Neale Haynes

I'd been struck by a detail in the publicity notes about the show, which made a point of stating: "Gordon is not there to fix prisons or mentor prisoners. Gordon is not there to fix prison food." His determination to make this very clear makes sense as soon as he starts talking about what he found behind bars.

"What I wasn't prepared for was how easy it was for them in there. I was astounded at the comfort zone they carve out for themselves. Five meal choices a night – that was the one I really struggled with. I just thought it was a bit of a joke, to be honest. Coupled with 24-hour television, Xbox, DVDs, gym. We can't watch television until four o'clock in the morning. I'd like to have a gym seven days a week, by the way." What he found didn't just make him angry. "Angry, yes, clearly – but quite embarrassed, really. I thought we were a nation of grafters; I thought we had the spirit of working harder than anyone."

In Ramsay's mind, his job was clear: he was going to teach the inmates not just how to cook, but how to graft. To his disgust, most of them turned out to be less than wild about joining his programme. "Yeah, and why would they want to come and bust their arse for 10 hours a day when it was easy for them to do nothing? I find that hard to come to terms with."

Did the lack of enthusiasm offend him? "Really offensive. Because it made my life harder. I was on egg shells from the minute I went in there."

He did know it wasn't going to be "like going into the Savoy and talking about Pyrenees lamb on the menu today", but a bit of jeopardy had appealed to him. "It had been a busy year, and I was ready to get down and dirty and, yeah, put my head in the noose."

He doesn't appear to have enjoyed it much, though. "From day one, just sat in that fucking waiting room, trying to get in, with no phone, and then being treated like a piece of shit. Everything was going against me; the system was completely screwed, the governor was treating me like one of his bitches. And I was banging my head against a brick wall."

Most reality television observes a familiar narrative arc – initial high hopes, dashed by disaster and resistance, rescued by a moment of high-conflict catharsis, followed by a degree of redemption. It's the format we see in makeover shows, from Supernanny to Wife Swap, and I can see why it suits Ramsay so well, because it requires no acting on his part.

"I kept telling them, 'It's not come cook along with fucking Gordon Ramsay. This is where you're going to put the work in.' So I turned it up; I levelled with them. I went, fuck it. I just said, 'That's it, I've had enough of your bullshit, I'm not here for that.' And then I lost it because one guy started complaining that I'd dirtied his stove." His lip curls with contempt. "They wanted to give me shit for dirtying a stove? I mean, have they any idea the amount of money it got to fit that place out? Even a professional chef, on the outside, doesn't just walk into a kitchen that good. So when he went for me, yeah, I went for him in a big way. I just went for him. I lost my rag, yeah. I lost it, and kicked him out. And that was the big turning point, I think."

Once the original 12 were whittled down to eight, things began to go much better. I ask if Ramsay can teach anyone to cook, and he flashes back, "Absolutely." Is there really, I wonder, nobody in the world who can't learn to cook?

Clearly, he hears a different question. "So you're saying that growing up with leftover food and bits and bobs and scrapings from mum's restaurant where she used to work in Scotland, and bringing home stuff that wasn't sold, and pretty basic food – growing up with that kind of food, and it wasn't about, you know, 'What would you like for dinner?', it was, 'There's your tea, and you're going to eat it, and you'll insult me if you leave any of it.' So I wasn't trained to have a palate."

What? That wasn't what I was saying at all. But Ramsay doesn't seem to listen to anything much; instead, he hears the questions he assumes I must be asking, and as his imaginary ones are generally veiled attacks insinuating all manner of criticism, he gets angrier and angrier. To make matters worse, whenever I mention anything from either of his autobiographies, he looks so surprised that I begin to doubt he had much to do with writing them, and wonder if he's ever, in fact, even read them.

War is the title of one chapter, which details the breakdown of his relationship with Marco Pierre White, who'd been one of Ramsay's most important early mentors. He fell out with the owners of his first restaurant, too, and before long had begun to clock up so many lawsuits that Lady Bracknell's observation about losing not one but two parents comes to mind. No one, surely, could fall out with this many business partners entirely by accident, so I'm curious to know what it is he so enjoys about a feud.

I get the impression, I begin to say, that he has quite a history of feuds. "Well, I think that's just part of the industry," he says dismissively. "Sport's the same." But he has clearly spent more time in court than the average businessman. "No, I disagree, I disagree."

Really? I cite one particular dispute with some customers who'd demanded a 50% reduction in their bill because one of the waiters had been ironing a table cloth in full view during their meal. Once again, Ramsay ended up in court, and eventually won. "We got our £600," I quote to him from the book, "and it probably cost us £3,000 to obtain it. I just couldn't let it go." I'm interested to know why it mattered so much to him.

"I didn't expect to sit here and talk about a fucking table cloth. You know, I don't sit and dwell on those things, to be honest. You clearly do." But almost immediately he's launched into a different anecdote about a legal threat from another customer, which he has actually kept and framed.

"An American threatened to sue me for 'loss of enjoyment' because he had a red mullet dish with an amazing summer minestrone and vegetables – it was a beautiful dish, and when this red mullet came, he asked for ketchup." The waiters explained that we don't stock ketchup, and the customer asked one to pop out and buy some. 'What is this?' I said. 'A wind up?' He said, 'I'm paying the money, that's how I choose to eat.' So I kicked him out."

Well, yes, I say, that was rather my point; I'm asking if he enjoys a row. "Of course I do."

I wonder if that was partly why he chose to publish the infamous letter to his mother-in-law in a newspaper, instead of popping it in a post box. In a flash, the woman next to him is on her feet, snapping: "I think we should get back to prisons." I don't see how I can be invading his privacy by mentioning the letter, I point out, when it was Ramsay himself who put it in the papers. "We're not going to comment there," she barks. She's starting to remind me of one of those attorneys in bad US courtroom dramas who jump up and down squawking, "Objection!" so I decide to ignore her.

I was going to ask, I explain, if any part of him gets some satisfaction from making a row public. "No, no, in terms of the ruck, that situation was pretty shit."

"Like I said," the woman interrupts again, "can we get back to prisons?"

Did he go public, then, because he was so scared he might lose his wife and kids? "I definitely wasn't scared. Where did I say that?"

It was in an interview he gave at the time, so I quote it to him: "They were jumping on Tana, using her as a target to manipulate and poison. Hoping she would just lift up the kids – my four children! – and jump in with them… They hoped to break down Tana, convince her that this is the right way."

"Yeah," Ramsay now agrees. "You know, I have a span about two inches long, so to push my buttons is pretty easy."

"I think we should get back to talking about prison," the woman glowers.

Right then, back to prison it is. Ramsay's brother Ronnie is a lifelong heroin addict who has been in and out of jail, where Ramsay has always refused to visit him, so I ask why. "Well, you know, wiping his arse in prison, I mean, how many chances do you give a guy?" The chef did put Ronnie into rehab at Clouds House in Wiltshire, though, and says, "Clouds is incredible – that setup there is just out of this world."

That's a surprise to hear, because he had written, "I hated Clouds. I hated everything about it."

I thought he found the whole place insufferable?

"No, it was more the recovering addicts that I couldn't let rip at."

I'm still a bit puzzled, and when I check later, the list of all the things he'd hated about Clouds included, "The counsellors themselves." Also on that list was the fact that Ramsay hadn't been allowed to wear aftershave or logos on his clothing when visiting. Ronnie's own appearance would provoke visceral disgust – "He was an absolute fucking mess" – and to Ramsay looks clearly matter a lot; he has had filler to smoothen the lines on his chin, and a new set of teeth, and accused his father-in-law of leaking stories about a hair transplant. A lot of people who become television stars talk about the pressure they feel to perfect their features, and I'm curious to know if that was the case for Ramsay, but at this point relations break down altogether.

"Can you get back to prisons?" the woman says. "I think we've got quite a lot that we want to say about prisons, and we've only got half an hour left." In that case, I suggest, why doesn't she take over and conduct the interview herself? "No, I think we'd just like to stick to prisons."

I look at Ramsay. The man who has made a career out of shouting at people on TV has brought with him not just a PR in charge of publicity for the programme, but this woman as well, who will not shut up. Why does the hard man of telly need all these bodyguards? "You've asked me lots of personal questions," he says peevishly. "I didn't sign up for that."

"Do you have any further questions about Behind Bars?" the woman demands. By this point, I don't think I do. So we gather up our things in icy silence and everybody leaves.

• Gordon Ramsay Behind Bars starts on 26 June on Channel 4.