In 1920, Glaswegian Catherine Carswell’s debut novel Open The Door! was published. The story of a young woman’s progress to maturity, independence and lasting love, the book sold all 9,000 copies and won a literary prize.

There have been countless reprints over the past century, and you can still buy it on Kindle. Go into any charity bookshop and you’ve a good chance of finding the green-spined Virago or white-spined Canongate editions, a novel as fresh and (sometimes wincingly) honest today as it was on publication. It's also a strong contender for that much-claimed title, the Great Glasgow Novel.

Carswell wrote from experience. Protagonist Joanna Bannerman testing her allure with a series of men she doesn’t love is a portrait of the author as a young flirt. Carswell's evangelical mother, her sister and two brothers are all faithfully rendered. The doggedly loyal Lawrence Urquhart is a thinly disguised version of the novelist’s second husband, Donald Carswell. The world-weary Louis Pender is a cipher for her great love, Maurice Greiffenhagen, who taught at Glasgow School of Art.

It is all the more intriguing, then, that she left one very significant figure out of the book.

In 1904, 25-year-old Cathie Macfarlane, as she then was, had given up hope of earning her living as a pianist and was studying English literature at Glasgow University. She was clever and strikingly attractive, but young for her age. Her professor, Walter Raleigh, invited her to visit his family at their holiday home in Berkshire. There she met 36-year-old Herbert Jackson, the brother of Raleigh’s wife, Lucie.

Jackson’s father had been art editor of the Illustrated London News. Herbert taught at Liverpool School of Architecture and Applied Arts before volunteering to serve in the Boer War. When Carswell met him he had been back from Africa for two years and was a full-time painter in London. With his soldier’s physique and brooding good looks, he must have cut quite a dash. He told her he had enemies and hinted at a secret trouble he would explain once they were married: just the sort of romantic mystery a young woman like Carswell found irresistible. What she didn’t know – and Raleigh and his wife were careful not to tell her – was that Herbert was a figure of some notoriety in Liverpool.

He was utterly smitten by her. She must have been strongly attracted, though she later described her acceptance of his proposal as “a desperately rational act.” Within a month of meeting, they were man and wife. Three months after that, he tried to kill her.

In Open the Door! Joanna’s first husband is Mario Rasponi, a stagey Italian whose one convincing characteristic is a controlling jealousy. He dies in a motorbike accident a few pages after the wedding, leaving the reader feeling distinctly cheated. The few lines about Carswell's first marriage in her piecemeal autobiography, Lying Awake, are so cryptic – and syntactically clotted – as to say almost nothing. But the dramatic facts can be found, in tiny print, in a footnote to the book’s introduction written by her son, John.

As soon as I read it, I had to find out more. So began several months of research, online and in libraries and archives across the UK. The story I uncovered had all the ingredients of fiction: passionate love, deception, misunderstandings, bizarre and heartbreaking twists of fate. Carswell had her own reasons for excluding this rich mix from Open the Door. I took it as the inspiration for my sixth novel, What We Did in the Dark.

On honeymoon in Italy, hundreds of miles from family and friends, Carswell discovered that Herbert suffered from delusions. He believed himself to be impotent. After a difficult few days, the couple started having sex, but it seems the delusion persisted. Some time later she became pregnant. They were crossing Lake Maggiore on a steamer when she broke the news. He accused her of adultery with the Prince of Wales and tried to strangle her.

This conviction that he had been cuckolded by royalty was just one strand in a complex web of paranoid ideas. He slept with a pistol under his pillow, sure that his former friends in Liverpool and another shadowy faction were plotting against him. He was followed by spies and informers. The newspapers contained coded references to him. The American multi-millionaire J Pierpont Morgan was his enemy. His food was poisoned. Nothing Carswell said to the contrary could change his mind.

After four months in Italy, the couple crossed the Alps on foot and caught a train back to London. Soon after, two psychiatrists and a pair of attendants arrived at their flat to take Herbert to a lunatic asylum. There was a struggle. Carswell managed to grab his pistol and throw it out of the window.

The immediate threat to her safety was removed, but she remained his wife and continued to visit him until he refused to see her. It was another four years before she won her freedom, at the cost of making their daughter Diana illegitimate, in a court battle that the press covered in lip-smacking detail. It became a leading case in divorce law.

Carswell's lawyers persuaded the court to annul the marriage on the grounds that Herbert had been mad, and thus incapable of making a legally binding contract, when he swore his wedding vows. Several former friends testified to this. He had generated endless gossip at the Liverpool University Club, challenging two fellow-members to duels and pestering a woman who had turned down his proposal of marriage. In London, he was fined for beating up a fellow artist.

This "madness" – which may have been Post Traumatic Stress Disorder – first manifested when he returned from the Boer War in 1902. He had served as lieutenant to an Aberdeenshire section of Royal Engineers. There, frustratingly, the trail runs cold. All I know is that he lost command of the section to a lieutenant who was subsequently mentioned in Lord Kitchener’s despatches.

The annulment wasn’t the end of Carswell's adventures. Needing to support herself and her child, she began working as a critic for the then-Glasgow Herald. She went on to make her mark as a journalist, biographer and novelist, one of the few women in Hugh MacDiarmid’s Scottish Renaissance movement. DH Lawrence, who helped edit Open the Door and became a close friend, wrote to her: “I think you are the only woman I have met who is so intrinsically detached, so essentially separate and isolated, as to be a real writer or artist or recorder.”

Her six books included a memoir about Lawrence, The Savage Pilgrimage, and a controversially frank Life of Robert Burns. She was threatened with a libel suit over the memoir (by John Middleton Murry, husband of the short story writer Katherine Mansfield) and the book was withdrawn. After the Burns biography was published, she received a bullet through the post, with a message urging her to “leave the world a cleaner place”.

Her second novel, The Camomile, featured a young woman who dodges marriage to an eligible stuffed shirt and pursues a writing career instead – although Carswell managed to enjoy both, second time around, with an old friend from her student days, Don Carswell.

What We Did in the Dark, by Ajay Close, is published by Sandstone Press, £8.99. Ajay Close discusses The Mystery of Marriage alongside Andrew Meehan at Aye Write on March 15.