Multiple possible reasons.
If the muscles weren’t relaxed enough during injection, then there will be resistance while inserting the needle which can damage the tissue.
Needle tips are sometimes sterilised with alcohol, which dehydrates local tissue when injected and cause discomfort.
Poor technique injects the short subcutaneously rather than intramuscularly, which doesn’t drain as well as muscle tissue so swelling can occur.
Latest Answers