I saw your test, and I get similar results attacking pierceable 10/10 HT/mech into 8/4 (yeah, I said I couldn't test because I don't have the DLC that gives the equipment tab, but I totally forgot you can see equipment destroyed on the battle summary).
A gun-buffed 8/2 space marine has 10% more soft attack and 20% more hard attack than the equivalent 8/4 AT infantry, and, like your test showed, this can be enough in certain circumstances to change the winner of the fight, but this doesn't mean that the bonus is the main advantage. The main advantage of space marines is to guarante the heavy tank will be pierced, the bonus attack is sprinkles on top.
Even under this ideal scenario, in which the pierceable HT is pushing AT inf on plains and wins, equipment losses in IC are worse for the tank if they are pierced.
View attachment 711529
ger(tanks) = 57*0.69 + 2.5 + 8 + 22 * 30 + 27*10 = 979 IC
eng(inf) = 319*0.69 + 4*3.5 + 16*4 + 8 * 2.5 + 54*6 = 642 IC
But with unpierceable tanks, tank div losses are roughly 1/3 of that
This exact IC argument has been made in other instances to show that space marines are OP. I wouldn't argue that this proves that space marines are OP, this proves that any relatively cheap means to pierce heavy tanks with infantry makes heavy tanks UP (and outclassed by mediums because of cost).
To say that space marines are OP, you would also have to answer: if your enemy is going space marines, can you beat them with medium tanks? Medium tanks are bound to be pierced anyway, so they already lose this IC trade vs AT infantry. The IC trade vs space marines is worse obviously (as the OP points out, space marines are better in nearly all aspects to AT infantry), but IC trade being worse doesn't mean it will be backbreaking, unlike the heavy tank that goes from not-pierced to pierced.
I tested a bit the IC trade of 2 40 width mediums vs 4 20 width space marines and vs 4 20 width AT and indeed, attacking on the plains (simplest test possible) space marines killed 40%-100% more mediums than AT inf, both losing the fight. This sounds crazy good (and it is indeed a massive difference), but part of this is because the combat was already pretty close to begin with, and the closer the combat is, the bigger the impact of any single advantage. If this space marine advantage leads to certain unwinnable scenarios in a real game with tons of buffs and debuffs flying around, I'm not sure, but here we're reaching beyond what simple tests can answer.
TL/DR: Allowing space marines is a great overall buff against tanks and completely invalidates heavies. Whether it breaks medium tank builds is debatable.