I don't have anything helpful to add but here is something I just ran into (with version 10.2). Here, E = EllipticCurve('162a1') -- but rerunning in a fresh Sage did not trigger the error. The number of bytes in the second line is rather more than my laptop has, I think (and pari.stacksize() is onlu 8000000).
sage: [E.reduction(p).abelian_group().invariants() for p in primes_first_n(50) if p%4==1 and p>3]
/usr/lib/python3.10/inspect.py:3186: RuntimeWarning: cypari2 leaked 140516603778792 bytes on the PARI stack
return self._bind(args, kwargs)
ERROR: removing wrong instance of Gen
Expected: [Mod(1, 173), Mod(172, 173), Mod(0, 173), Mod(167, 173), Mod(8, 173), Mod(170, 173), Mod(161, 173), Mod(32, 173), Mod(113, 173), Mod(124, 173), Mod(120, 173), Mod(25, 173), Mod(55, 173), Vecsmall([3]), [173, [112, 94, [6, 164, 3, 0]]], [177, [[177], 1], [[Mod(146, 173), Mod(122, 173)]], [177, [3, 1; 59, 1]]]]
Actual: [Mod(1, 113), Mod(112, 113), Mod(0, 113), Mod(107, 113), Mod(8, 113), Mod(110, 113), Mod(101, 113), Mod(32, 113), Mod(53, 113), Mod(71, 113), Mod(61, 113), Mod(22, 113), Mod(84, 113), Vecsmall([3]), [113, [4, 96, [6, 104, 3, 0]]], [129, [[129], 1], [[Mod(21, 113), Mod(32, 113)]], [129, [3, 1; 43, 1]]]]
ERROR: inconsistent avma when removing Gen from PARI stack
Expected: 0x7fcc924092a8
Actual: 0x7fcc9240d190
ERROR: removing wrong instance of Gen
Expected: [Mod(1, 109), Mod(108, 109), Mod(0, 109), Mod(103, 109), Mod(8, 109), Mod(106, 109), Mod(97, 109), Mod(32, 109), Mod(49, 109), Mod(79, 109), Mod(79, 109), Mod(27, 109), Mod(90, 109), Vecsmall([3]), [109, [47, 94, [6, 100, 3, 0]]], [99, [[33, 3], 3], [[Mod(30, 109), Mod(35, 109)], [Mod(91, 109), Mod(3, 109)]], [33, [3, 1; 11, 1]]]]
Actual: [Mod(1, 173), Mod(172, 173), Mod(0, 173), Mod(167, 173), Mod(8, 173), Mod(170, 173), Mod(161, 173), Mod(32, 173), Mod(113, 173), Mod(124, 173), Mod(120, 173), Mod(25, 173), Mod(55, 173), Vecsmall([3]), [173, [112, 94, [6, 164, 3, 0]]], [177, [[177], 1], [[Mod(146, 173), Mod(122, 173)]], [177, [3, 1; 59, 1]]]]
/usr/local/sage/sage-10.2/src/sage/schemes/curves/projective_curve.py:221: RuntimeWarning: cypari2 leaked 14760 bytes on the PARI stack
Curve_generic.__init__(self, A, X)