Mary Pershall dared to hope. Her daughter, Anna, had agreed to go to rehab, to tackle her dependence on alcohol, synthetic cannabis and ice. In return, Mary had put aside her scruples and driven to an adult store so that Anna could buy synthetic cannabis. It’s not an uncommon bargaining chip used by despairing parents. It would keep Anna’s withdrawals at bay until she was safely under medical supervision, but also – hopefully – secure her cooperation.

Not long after, Mary was chopping vegetables in their comfortable home in Oak Park, a northern suburb of Melbourne, when she spotted Anna walking briskly off down the driveway. She dropped the knife and ran after her.

“Where are you going?” she asked desperately.

Anna was unfriendly. “For a walk.”

“I’ll come with you.”

Striding ahead, Anna detoured into a McDonald’s and ordered two large Big Mac meals. As Mary scrambled to pay, Anna started dismantling her food, smearing it on the table.

“I’m going outside for a smoke,” she said.

After a few minutes of clearing up the mess, the penny dropped for Mary. She rushed outside. But Anna was gone.

It’s a typically frantic scene from Gorgeous Girl, Pershall’s book about years spent herding a child with severe mental health and addiction issues – a child who is now in jail for murder. She uses it to illustrate that the window of opportunity for someone like Anna to be open to treatment is small – too small for the waiting lists of government-funded facilities. As Pershall says, 10 days might as well be 10 years.

‘I have to divide my mind between what happened to Johnnie, which is the most unimaginable horror, and what’s happened to Anna,’ says Anna’s mother Mary.

Over the next two years, Anna’s troubles escalated. She habitually befriended strange men and brought them back to the family home to take drugs; was often covered in bruises and cigarette burns; and was found naked in a service station in Footscray. Then, in November 2015, she fatally stabbed her housemate, Zvonimir “Johnnie” Petrovski, in a row over cigarette money. Anna was 28 years old and pregnant. She was sentenced to 17 years.

Gorgeous Girl is Pershall’s first book of non-fiction, but she was already a renowned children’s fiction author, even penning a young-adult trilogy with Anna. She meets with Guardian Australia at a Melbourne cafe, accompanied by her other daughter, Katie Horneshaw, for moral support. As a freelance writer herself, published in News.com.au, Ten Daily and Mamamia, Katie covers social issues, including articles about how Anna fell through the cracks of the Victorian mental health system. She says they have been amazed at the “mental gymnastics” the public has performed, “to accept that Anna did this terrible thing and yet ... doesn’t deserve to be put down as a monster”.

“There were failings that happened into the lead up to it, but both Anna and us as a family absolutely believe that she deserves to be punished and she got a fair sentence.”

Frequently, Pershall ponders in the book, “Was this the moment we went wrong?” – whether it be not seeking a diagnosis when Anna was a child (she was eventually diagnosed with a personality disorder and a schizoid-type illness), or not shelling out $30,000 for private rehab, which Anna would very likely have walked out of.

Anna’s struggles were apparent the moment she started school. She would make screeching animal noises in class and talked at children – who began to target her – rather than to them. She first ran away at the age of six. Persistently, she suffered auditory hallucinations, which Pershall explored in her Ruby Clair series of books, in which a 12-year-old girl tries to integrate ghosts into her everyday life.

‘Trying to fix Anna was a huge focus of all our lives. Towards the end, she didn’t want to stay alive,’ says Anna’s older sister Katie.

As a teenager she developed anorexia, reflected in a book she co-wrote with her mother – Escape from Year Eight – which touches on her fixation with food. At 15, she kicked in an estate agent window, and a year later, went train surfing. It was a relief to her family when she met a nice boy and moved in with him. But she wasn’t able to hold down a job and started drinking during the day out of frustration. The relationship didn’t last.

During one of Anna’s long stints back at the family home, Mary Pershall created The Saving Anna Project in a ring-binder. There’s little she didn’t try, from getting a priest to bless Anna’s room – of which her daughter was frightened – to calling the police. Needing some respite for themselves, the family utilised a charity that provided a carer for 25 hours a week. That carer – a much older man – abused his trust and pursued a romantic relationship with Anna, who was now in her 20s.

She was this beautiful young white woman, so people didn’t take her seriously when she was being violent Katie Horneshaw

As medical professionals are painfully aware, the most vulnerable, low-functioning members of society fall between the cracks because of the way that medical services are siloed. Frequently, Anna couldn’t get help at a rehab because her mental health issues were too complex; nor could she get help at a mental health facility because she was still addicted to drugs. On one hospital visit, it took nine medical professionals to wrestle Anna into a bed, with one nurse copping a bite. Anna was still sent home. A Crisis Assessment and Treatment (CAT) team advised Pershall to simply draw up boundaries for Anna. “A sheet of A4 paper was too flimsy a thing to hold between my daughter and a band of howling wraiths from the underworld,” Pershall writes.

One problem, says Katie, was that Anna never stuck around long enough to get a definitive diagnosis. “Doctors have speculated that she’s got everything under the sun.” If there had been a shared database for hospitals and doctors, they might have registered Anna’s pattern of escalation. Instead, each hospitalisation was taken as if it was one singular incident, even when the family protested that it was not. As Katie points out, that database is now available through My Health Record, but she cautions that the service should be voluntary and only accessed with the patient’s consent. Still, “In Anna’s case, she wanted this record to exist,” she says.

At first, Anna was fearful of seeking treatment, but on two occasions requested she be held longer in hospital. This requires sign-off from two psychiatrists, but she could only get one to agree. “She was worried that she was a danger to herself and others,” says Katie, “but she was this beautiful young white woman, so people didn’t take her seriously when she was being violent.”

Katie, who now cares for Anna’s son, is used to taking a stewarding role with her younger sister, who began to think her parents were “literally possessed by demons”. “Trying to fix Anna was a huge focus of all our lives. Towards the end, she didn’t want to stay alive. It wasn’t gaps, it was minute to minute. You might go from trying to pull her away from the wall she’s bashing her head against, to trying to argue that no you shouldn’t have any more to drink, to lying beside her to check she’s still breathing.”

Anna and her godmother Gill, on Anna’s 18th birthday.

The family calls the murder “Black Sunday”. It’s easier than the actual word. Prior to the book coming out they had to decide how to tell friends, family and acquaintances about what Anna had done – or not. Those outside of the ever-diminishing circle of friends who were privy to Anna’s struggles have certain expectations of grief and distress that they project onto the family. “It’s hard to deal with those expectations,” Pershall allows. “I have to divide my mind between what happened to Johnnie, which is the most unimaginable horror, and what’s happened to Anna, which is the best thing for her.”

The proceeds of Gorgeous Girl will go to Prison Network and Uniting ReGen, and Anna has written to her mother and sister, saying, “I’m proud of you for trying to help other people in my story”. In prison, Anna takes part in the theatre group Somebody’s Daughter and has started a book group. She’s shown fellow inmates the cover of Gorgeous Girl, although she doesn’t think she’ll bring herself to read it. Her meals and medication are organised. She sleeps well. She’s drug-free.

“We tried as a family to do that for her but it was impossible,” Katie says. “Now her social skills have improved, her outlook on life has improved. This amazing woman has emerged. I can be her friend now.”

• Gorgeous Girl, by Mary K Pershall, is out in Australia on 20 August through Penguin Random House. It is available globally as an audiobook through Audible