ummm dont think that should ever happen!
Thery are called spontaneous pheumothorox events and you are lucky you were with a physician. These can happen at any time. There was no malpractice or negligence.
It was coincidental and had nothing to do with the injection. There is a possibility it had something to do with the referred shoulder pain.
The important thing is that you were treated and recovered.