This implication also contradicts the original meaning of the Bones nickname, it was a common nickname for military doctors in the past and TOS did have a lot of military flare.
It doesn't contradict it at all. It
adds to it!
Most nicknames stick for a reason. They can mean more than just one thing to people. Sometimes nicknames fall by the wayside, sometimes they inexplicably stick.
For example, one of my nicknames is "Eenie", because a young girl I used to babysit couldn't pronounce "Ian". But... it also made my family recall the old "Rocky and Bullwinkle Show" of decades ago, specifically the skit where Bullwinkle is trying to do magic and says,
"Eenie weenie, jelly beanie." So the "Eenie" nickname stuck because it meant more than just one thing to us.
A few years later, after I'd became an adventurous adult and moved out of home, a different friend perverted my nickname to "Easy". To her, it was an hilarious in-joke about a conversation we'd once had about people we knew only becoming sexually active after moving away from home. No one else ever got the joke.
Kirk brings together his very first conversation with the doctor and the old "sawbones" reputation of doctors in general: a new nickname is born that sticks.
By the way, according to the writers' guide for "The Cage" pilot and the series premise, Dr Boyce was also nicknamed "Bones".
For the sake of today's audience, another reason probably had to be devised.
No, Urban improvised the line in his audition and JJ and the writers loved it and added the line to the script.