The SGMII link appears to be up the whole time, and at no point does it fall back into the negotiation state. So the link is probably *not* actually flapping; this smells like a bug on the microcontroller side.
We expect g13 (phy address 1) to be down, and g12 (phy address 0) to be up at 1 Gbps.
Looking at the actual MDIO bus traffic in this capture, we have:
* PHY 1 ctl: 1G/full
* PHY 1 stat: Down
* PHY 0 ctl: 1G/full
* PHY 0 stat: Up
* PHY 1 ctl: 1G/full
* PHY 1 stat: Down
* PHY 0 ctl: 1g/full
* PHY 0 stat: Up
Nothing seems obviously wrong here.