If you can show a picture, I could tell you which organ or tissue you've probably hit (or you take a look at
this to get an idea). Chameleons' skin is quite thin, so a needle which has found its way between two ribs inside the body can hurt the animal, of cause. A needle which only "scratched" along over the ribs won't have damaged organs.
But to pacify you a litte: Most organ tissues adhere quickly after getting injured with wound sizes like those caused by an average needle gauge (and some organs simply draw aside). But it depends on which organ you actually hit and how much the needle was moved sticking inside the body (more movement - higher chance of having hit an organ). Another point ist the active agent and dosage of the medication given, and how much was injected accidentally while inside the body and not under skin. I would definitely watch the chameleon during the next hours, and visit your reptile vet soon to let him check everything's ok.
Antibiotics can be given per os or as injections into muscle or subcutaneous to name only three ways for systemic administration. Usually one decides the "right way" for a patient depending on sickness, condition of the animal, background informations, species, cooperativeness of the patient itself, skills of the patient owner, used active agent and so on. There's no perfect way for every single patient, so medication administration can always change from one to the other.