Joanne Rowling adopted the middle name Kathleen before publishing Harry Potter.
Rowling was born Joanne Rowling in 1965 and did not originally have a middle name. Her publisher, Bloomsbury, reportedly wanted a name with two initials because it was thought that boys might be less likely to choose a book by a female author. Rowling selected Kathleen, her paternal grandmother’s name, creating the pen name J. K. Rowling.
The initials do not stand for “Joanne Kathleen Rowling” as a birth name. They became part of the author identity used on the Harry Potter books, although Rowling has generally been known publicly as Joanne or Jo. The “K” is therefore a chosen middle initial rather than evidence that Kathleen was her original middle name.
A related point is that Rowling later used another constructed author name, Robert Galbraith, for her crime novels. That pseudonym served a different purpose: it allowed her to publish the Cormoran Strike series without the immediate expectations attached to Harry Potter.