Had similar a couple of times in the past, as a result of over developed chest muscles (can’t say I’d ever noticed 😳 ) and under-developed upper back muscles. Basically the upper back muscles were under constant strain which reduced the blood flow to them, any movement with weight out in front of your body (moving cardboard boxes or a bike box were my two triggers) and the muscles spasm, crazy breathless painful!
I got over it with heat and gentle massage on the muscles which loosened things up after a couple of days.
Then it was just a routine of strengthening the muscles behind the shoulders and stretching the muscles across the chest. Probably worth seeing a physio to help you with those.