GPS doesn't use a compass. It calculates range and bearing to a waypoint (etc.) by calculating the triangle between your Lat/Long and the Lat Long of the target. Maybe it was having a "trigonometry moment."
A magnetic anomaly would affect the ship's compass and the autopilot's compass but not the GPS's internal calculations.
You wuz hacked . . . or the chart plotter/GPS has a bug. It's summer in Maine -- it probably caught a cold.
Back in the days of LORAN, things would get quite wild on approaching Annapolis. The huge radio antenna array near the Naval Academy played havoc with radio signals. One minute you're doing 6 knots, next thing you know its 349 knots. I don't know if there is any known local "GPS anomaly" in Seguin.