Ian Rankin’s fictional detective survived military service during the Northern Ireland Troubles, fist fights with criminals and bent cops in his native Edinburgh, and even a lifetime of heavy drinking and smoking.

But DI John Rebus is being forced to confront even more challenging circumstances: Scotland’s independence debate.

Earlier this week, Scotland’s first minister, Nicola Sturgeon, revealed that Rankin told her Rebus would have voted no in the independence referendum five years ago.

However, Ken Stott, the Scottish star of ITV’s Rebus adaption, begs to differ. In a letter to the Scotsman newspaper, he claimed Rebus’ ancestral roots instead made him a natural yes voter.

Ian Rankin in the Oxford Bar, Edinburgh. Photograph: Murdo Macleod/The Guardian

“Let’s look briefly at just one aspect: [Rankin’s] creation was the grandson of a Polish immigrant, therefore I suspect Rebus would be well aware of the humiliation and degradation suffered by so many immigrants at the hands of the Home Office then and now. This may, in turn, lead him to ‘think carefully’ before voting and to consider how his grandfather might have fared in the ‘hostile environment’ of a pre/post Brexit UK,” his letter said.

The actor, who played the dwarf Balin in The Hobbit film trilogy, even accused Rankin of “projecting himself on to a much-loved character”.

Last weekend, Rankin was interviewed by Sturgeon at the Bloody Scotland crime writing festival in Stirling. Sturgeon, who is a fan of Rankin and Scottish crime fiction, challenged him on the way Rebus would have voted in the referendum.

“I think Rebus, if you’re talking about yes or no to independence, which I assume you are, and not Brexit, the thing about Rebus is Rebus likes the status quo. He fears change, he doesn’t like change, and is very set in his ways. I think he would be a no,” Rankin replied.

Rankin and Stott did not respond to requests for comment before publication.

In 2014 Stott, who was born in Edinburgh, expressed his “wholehearted” support for Scotland’s independence although he could not vote in the plebiscite because he was living in London.

It is not just the union on which Rebus and Stott’s allegiances diverge. Football may be another issue ripe for debate in the detective’s beloved Oxford Bar: Stott supports Heart of Midlothian while Rebus (on television at least) is a fan of their Edinburgh rivals Hibernian.

• This article was amended on 30 September 2019 to correct the spelling of the Scottish city of Stirling.