It's called bracing. Usually resulting from your neck muscles. When you tense your shoulders, you pull your rib cage up and out of alignment, which also messing up your lung capacity. Double whammy, misalignment and lack of oxygen. This can cause super spasms in your rib cage area. It's soft tissue damage made worse by the bracing.
The only thing that has helped me so far is a gifted massage therapist that does something like rolfing. She digs into those spasmed muscles and releases them. It hurts like hell! I'm usually sore the next day, but the pain is often gone within a day or two. If I stop going to her, and I'm stressed at all, then wham, the cycle starts all over again.
This last flair up was due to a long term cough from the flu or something. That started the whole thing all over again.
Yes, many think it is a heart attack, that is really common. And the pain does cause a bout of hypochondria because you simply can't believe that it's not something that is killing you because the pain is so bad. It's your torso area, hard to not move it, hard to let it heal.
Everything you are saying I've heard before many times. You are not alone, there are many people with chronic costo. All I know is that that massage technique has saved my butt.