Carys Bray grew up with the certainty that her God-ordained destiny was to become a mother. So when she was beset by the all-too-familiar doubts of so many new parents in those sleep-deprived early years, they felt tantamount to sins.

"Because motherhood is your role in this life and the next, to say, 'Actually, I'm really not enjoying this that much and I think I might like to do something else at some point' is quite difficult. You're supposed to be a wonderful mother and absolutely love it."

There's a Mormon text still used today that states: "No career approaches in importance that of wife, homemaker, mother – cooking meals, washing dishes, making beds for one's precious husband and children."

Carys is talking to me from her home in Southport, Merseyside. There are about 100 practising Mormons in Southport, which has a population of 90,000, so while being a Mormon child at school was rare, it wasn't remarkable. Raised within the 180,000-strong British Mormon community, She grew up in a family that was "very, very obedient. Obedience is the first rule of heaven; whatever the prophet said, we tried to do it." When it came to women, the prophet was quite clear. Stay at home and be the best wife and mother you can.

As an adolescent, Carys's perceived destiny chafed with her nascent ambition. "I had all these ideas; I thought I'd like to work in a university because I loved school." But unlike some adolescents who throw off the religion they are born to, she stayed with it. When she turned 18, however: "It was like I'd been reset to 'default' mode or something. All that stuff about marriage came to the forefront of my mind. If I left it too long, if I said I wasn't getting married until I was a bit older, there might not be anyone left."

Marriage – to Neil, a fellow Mormon – won out over any other putative goals, and motherhood soon followed. Mormon women are encouraged to have as many children as they feel able to. "I was pregnant by my 21st birthday," says Carys. "I did feel a sense of, 'I'm 21 and pregnant; that's not really what I had planned.' But it seemed wrong to put off having children."

Life was tough. "We were quite isolated, and had really no money because Neil was a student." To make ends meet, Carys took on a part-time job, but that brought its own problems. "I decided to work nights so I wouldn't be away from my children during the day. I felt guilty about working and was so exhausted I was physically sick."

Carys was soon pregnant again, but her second baby, Libby, died just days after birth from an undiagnosed genetic condition. Here, too, her instincts were at odds with Mormon teachings, which state that you are, in essence, reunited with the deceased on your own death. "People would say, 'Oh, but you'll get the chance to bring her up [in the celestial kingdom].'" Some people might have found this comforting, says Carys, but it didn't help her.

Depression set in after the birth of her third son. "I was miserable for a long time. Then he was a really challenging toddler, and I thought, 'It must be my own fault for being miserable.'" Seeking help felt impossible as Mormons are required to be "very cheerful and happy and a good example to non-Mormons".

By the age of 27, Carys was at home with four small children. Her doctor prescribed medication. While the depression lifted somewhat, another concern arose. "I was so ashamed about the antidepressants I didn't even tell Neil. I was supposed to be really happy and love being a mother and I was finding it really difficult. I didn't know how to tell him."

The religious code affected family life in multiple tiny ways too. At school, certain activities needed to be negotiated in a faith-friendly manner: "If the kids brought raffle tickets home from school we used to send them back with a donation because buying raffle tickets was gambling, and gambling is against the teachings of the church."

While Carys had been able to override her own ambivalence about aspects of her faith, she found this harder to maintain as her children grew up. Carys' eldest son is a natural non-conformist, she says with a laugh. How did she reconcile his scepticism about the rites of their religion with her own hitherto unfaltering acceptance?

"It was strange to step outside of it and watch this little person who had quite fixed ideas about what he expected from life. I had the choice to confront him and sort of bully him into it, or to gloss over it. I was so embarrassed, not for him, but for myself, because I just wasn't able to do the cajoling that was expected of me."

Carys found the convictions that had been so entrenched as a child starting to erode as her own offspring questioned them. Bit by bit, she and her husband relaxed the rules they themselves had followed when young. "At first we didn't allow the children to go to birthday parties on Sundays because that would be breaking the sabbath. I changed my mind about this – I wanted the children to feel part of things with their friends."

Carys and her husband realised that the best way forward for their family was to leave the church. "Libby dying did open things up a bit, but there was no major moment when I thought, 'I don't believe any more.' It was gradual. I think I stopped believing in God before I stopped believing in Mormonism."

Having reached such a huge decision, they felt it was important to make the change before their children were much older. "Once children turn 12 they start having bi-annual 'worthiness interviews' with the bishop. He checks that they are keeping the commandments - not drinking alcohol, not smoking etc and also keeping the law of chastity. And when boys turn 12, they are ordained as deacons and take up active roles in the church. It seemed like it might be a good idea to leave before these things started to happen."

For the four children, then aged 11, nine, seven and five, the organising structure of Mormonism was all they'd known. Carys and her husband considered how best to depart with minimal disruption. "We took it to pieces over a year, doing things like occasionally skipping church." The children were involved in the decision, too. "We felt it was really important that they had some say in what happened to them. I don't feel like my children's religious beliefs are any of my business," Carys explains. They all accepted the choice without demur, although their youngest son did ask to keep going – but only to see his friends after the service so that he could swap Pokémon cards.

Five years on, Carys has fulfilled her childhood ambitions. She teaches creative writing at Edge Hill University, where she is completing a PhD, and her forthcoming novel A Song For Issy Bradley has been lauded by Nick Hornby as "wry, smart and moving". While she has no regrets about taking her family out of the church, she feels that there were definite benefits to her own upbringing. "Being a Mormon gives you an incredible amount of confidence from a very young age, and you had a set of ready-made friends with whom you had loads in common."

And though none of the children really remembers their early religious immersion, whispers of it sometimes emerge. "We'll be on a car journey and one of them will start singing, 'Follow the prophet, follow the pro-phet …' It's a real echo from the past."