This is what JK says about it back in 2018:
Why the name Robert Galbraith? Do you have anything to say to all those Robert Galbraiths out there?
I can only hope all the real Robert Galbraiths out there will be as forgiving as the real Harry Potters have been. I must say, I don’t think their plight is quite as embarrassing.
I chose Robert because it’s one of my favourite men’s names, because Robert F Kennedy is my hero and because, mercifully, I hadn’t used it for any of the characters in the Potter series or The Casual Vacancy.
Galbraith came about for a slightly odd reason. When I was a child, I really wanted to be called ‘Ella Galbraith’, and I’ve no idea why. I don’t even know how I knew that the surname existed, because I can’t remember ever meeting anyone with it. Be that as it may, the name had a fascination for me. I actually considered calling myself L A Galbraith for the Strike series, but for fairly obvious reasons decided that initials were a bad idea.
Odder still, there was a well-known economist called J K Galbraith, something I only remembered by the time it was far too late. I was completely paranoid that people might take this as a clue and land at my real identity, but thankfully nobody was looking that deeply at the author’s name.
Here's the link if you're interested
Oh and just in case you'd misunderstood, the transwoman character is not in all the books, I think maybe just in one? They are a series of books where the main character investigates crime.