Hi, blue ...; welcome to the forum.
I think the jury has reached a verdict. I'd vote for guilty on the margarine. "Margarine" is too generic term these days; it ain't what it used to be. Most of it contains no animal fat and the number of solids it's manufactured with (no two brands are alike) and air that's whipped into it makes it unsuitable (IMO) for any serious cooking. I wouldn't even use it to fry an egg.
If you insist on using margarine, try mixing it 50/50 with vegetable shortening or butter and see if that helps any.
Take a look at this thread:
New margarine for baking