Was very constipated and bloated with very hard stomach took magnesium citrate and felt relief but minutes after still got very bloated with pain in left lower abdomen, what could this be?

Constipation. Magnesium citrate temporarily relaxes the smooth muscle in the large intestine and allows hard stool to start to move through it. The pain you might be feeling is still the hard stool pushing its way through. I would use an OTC medication like Miralax (polyethylene glycol) which draws extra water into the large intestine, increasing motility and making the stool softer as it passes through to the rectum.