Many years ago, when I was a newly qualified clinical psychologist, I went through a painful break up with a boyfriend. Seemingly out of the blue, it was over. I hadn’t seen it coming. I was reeling – and in that week, it was sheer force of will that got me out of bed and into work.

Then in walked Annie for her first session. I distinctly remember that first sight of her as she strode purposefully into the office. I clocked her knee-length boots, her natty turquoise jacket and stylish silver bracelet. “I was early, so I bought this in the bookshop,” she said, waving a paperback. “I’ve been wanting to read it for ages.”

I’d started reading the very same novel the previous week and I fought the urge to tell her what I thought of it. She sat down and made a joke about the picture on the wall. She was sharp and funny. I heard myself laughing, a little too loudly. She smiled. It was a moment of connection and I felt that surge, the almost childlike excitement of meeting a new person in adulthood who you like. We could be friends, I thought.

'I’m never going to meet anyone like him,' she said. I bit my lip. I wanted to cry.

“So, what brings you here today?” I asked, as I pulled myself away. I was back in role. She was a client. I was her therapist. Then she told me about the problems she was having. A break-up with her long-term boyfriend. Her feelings of bewilderment, grief and loneliness. “I feel all at sea,” she said as she twisted her fingers in her lap. All her jaunty confidence dissipated as she slumped back into her chair. She talked about the years she had spent with her partner and her devastation about the loss. “We talked about having kids,” she said, her voice cracked. “I thought he was the one.”

I caught myself on the verge of welling up. I looked down at my notes, then reached into my bag for a pen. I blinked fiercely. I needed to steal a few moments away from her vulnerability, which was tapping right into my own and the similarities of our situation. As the session continued, I found myself nodding, identifying with her fury, her sense of injustice, her envy of her married friends – a litany of complaints that served to anaesthetise her from her sadness. “I’m never going to meet anyone like him,” she said quietly. I bit my lip. I wanted to cry.

What person in their 20s has not suffered heartache? Annie and I were no exception. I felt the pull to empathise with her and, in my mind’s eye, I saw us huddling together and commiserating over our shared stories. This may have given us temporary relief, but that wasn’t what she needed from me. And that wasn’t the job I was there to do.

To some, the boundaries between therapist and patient seem an unwanted barrier, an unnecessary power relation, a wall behind which the therapist defends themselves. But the boundaries are there for a reason. They offer containment, but more, they offer a blank screen on to which the client can project their feelings, uncontaminated by the therapist’s own “stuff”. The consulting room is not a place to look for or find friendship.

Transference and counter-transference are integral and essential to the work of therapy. Clients project feelings, unconscious messages, on to a therapist (most often these will mirror a pattern of relating from key relationships in their own life – parents, siblings, partners and friends) and the therapist can, in turn, pick up on the powerful feelings in the room (counter-transference) and use them as clues to what the client might be experiencing. Once a relationship has been established, the work can begin on shifting old patterns of relating that may be destructive or holding the client back in life. But for all this to work, the therapist needs to be as empty, or as “blank”, as possible.

Therapists can also have lives that are broken and fragmented

There will be times when it’s hard for a therapist to be emotionally available for a client in this way, especially when they overidentify with, or have experienced a similar experience or trauma as their client. Transference and counter-transference can be contaminated and passing the person on to a colleague may be in the best interests of all concerned, especially the client.

That first session with Annie was a powerful learning opportunity for me. It was the first time I’d seen a client whose life resonated so profoundly with mine. It wasn’t simply an experience I was looking back on, but one I was right in the thick of. I felt my own feelings and emotions being nudged into play and very quickly any objectivity became murky. Collusion was inevitable. What were my feelings? What were Annie’s? What were her strategies for dealing with the heartache? What were mine? I liked her, but I also liked the fact we were kindred spirits. Perhaps we could help each other? My therapist brain kicked in. I realised I needed to “take” Annie to supervision.

I wasn’t fully aware of my personal feelings about my own break-up until, to my horror, in the midst of explaining my dilemma to my supervisor, I burst into tears. Clearly my facade about being “fine” was flimsier than I thought and hearing Annie’s story proved to be the pinprick to burst my bubble of denial.

My supervisor was kind and supportive, but she was unequivocal. “She’s not the right client for you to see at this point,” she said and, in fact, was able to take her on instead. It was both a relief and a disappointment not to see Annie again, but it was a formative experience that undoubtedly made me a better practitioner.

By all accounts, my loss was small in the grand scheme of things. But what if it had been something of a more seismic nature? What if the searing private grief of a therapist stops them doing the right thing in the interest of their client? What if a new client arrives and looks so shockingly like their missing 17-year-old son that they think, for one beautiful moment, it’s him?

This is what happened to Ruth Hartland, a trauma psychotherapist who is the protagonist in my debut novel. The book not only opens the door into the secret world of the therapist and client, but also explores the all-consuming nature of maternal grief. Ruth is bereft. She is looking for her missing son, and as it turns out, her new client Dan, is looking for a mother. It’s the perfect storm.

Ruth knows she should refer Dan to someone else, that she is unable to offer containment or objectivity. The first mistake she makes is not referring him to a colleague straight away. The second is offering him more than the standard number of sessions. And so it goes on… Each time she crosses one of these invisible lines, it raises the stakes and becomes harder to pull back. These small transgressions have a domino effect, until she loses all professional focus, setting in motion a tragic chain of events as her feelings about her son and her patient become fatally muddled.

This is the world of fiction and in my experience, transgressions like this are very rare. But therapists are human beings. They have lives outside the therapy room. They have to manage sickness, bereavement, separation and the ill health of loved ones. Sometimes their lives can be as crumbling and as fragmented as those of their clients. Sometimes these stresses make it hard to help others. It’s why there is a robust structure of supervision to support and oversee all work. Also, most experienced therapists have been through their own rigorous therapy and so have a greater level of self-awareness for situations that might render them vulnerable.

I was lucky enough to have a supportive supervisor and team, and also had insight into my personal situation. Ruth, my character, does, too, but on account of her longing for her son, she chooses to ignore it.

I have often thought back to that session with Annie in the early days of my career. It showed me how identification with a client could very quickly take the work off course. It was a valuable experience and one that taught me more about the importance of therapeutic boundaries than I could have ever hoped to learn from a text book.

Bev Thomas now works as an organisational consultant in mental health and other services. A Good Enough Mother is published by Faber & Faber at £12.99. To buy it for £11.43, go to guardianbookshop.com