Did it hurt? If you felt a sudden pain, it was a nerve that you hit. You aren't going to damage yourself that way but yeah it does smart, feeling that shooting pain.
If you touch bone, nothing will happen! I can assure you of that!
I inject into my thigh and I started out with one inch needles. Sometimes some of the T would leak back out of my leg after I did the injection. I told my doctor this and she said that meant that I wasn't injecting deep enough because if it was right in the muscle the fibers would close up as the needle pulled out and that would trap the T oil.
She gave me a longer needle, one and a half inches long. I inject as deep as I can go but without getting it all the way in I ALWAYS hit a spot where it is impossible to push in further. That IS the bone. It does not hurt. There is no pain. I do not feel it in my leg, but I feel as I try to push the needle in further that it simply will not go, and there is always the same amount of space. It's fine.
I then inject as usual and do it slowly, taking about three minutes. When I pull the needle out, nothing leaks. So no, hitting bone isn't an issue and never will be. The needle is simply not able to go into your bone. Wouldn't happen no matter what you did, and the surface isn't going to feel pain from a skinny little needle tip poking it.