I have had this same thing happen. In my case, I was able to "fix it."
Some things not mentioned so far:
It matters whether you have the older, or newer / upgraded model of the AP. With the DigiFlight series, the older models used an internal magnetometer. In the event of loss of GPS signal, as others have noted, the AP will attempt to "maintain last heading" using the magnetometer as a source.
This was not found to be always "reliable" (and in my case was eye-opening, as it was for the OP, but it was VFR so not dangerous). In some installations, magnetic interference behind the panel caused the heading to "wander" significantly. Even in installations where it CAN work satisfactorily, it probably WON'T unless you have completed the magnetic compass calibration as described in the manual.
There can also be issues if there are pins that do not connect well to your ARINC source. This can cause erratic behavior.as well.
I had BOTH problems (intermittent connection and neglected to perform the mag calibration). Since addressing both issues I have purposely induced GPS failure in all modes (I have ARINC connected to my GNS 480, and serial connected to my 496). It tracks mag heading with < 5 degree heading change after losing source GPS, and doesn't seem to "wander" in heading more than a degree or so.
The newer versions (or upgraded, if you ask for it) have removed (or disabled?) the magnetometer. In these models when GPS is lost the unit will attempt to prevent heading change, but doesn't really know which direction it is headed. Over time, if unnoticed and in turbulence, I suspect your heading could drift but don't know how much or how fast. I considered the upgrade, but since I got my bugs worked out I prefer the option to have it steer magnetic in the event the GPS constellation takes a dump.
Last tidbit for this series of AP. Although TT does not ADVERTISE it as a feature (and I have harangued them about missing an opportunity), I believe it is a good idea to have the two GPS hookups come from different GPS units. In my case a GNS 480 is "primary" and connects via ARINC; the 496 is backup. I have my GNS configured to cross-fill my flight plan to the 496, and have verified that if power is lost to the 480 the 496 retains the last flight plan. With this setup, in the event that your primary GPS takes a nap during flight you get two benefits:
a) The AP does not have to rely on either mag heading or attitude - it will fly GPS track mode as it's "degraded mode"
b) Simply pushing the NAV button will resume flying the flight plan while you figure out what went wrong with your primary GPS - important if you are flying airways with lots of turns out east
Last thought - I have considered installing a switch to PURPOSELY disconnect the GPS units from the AP. This would allow "steering" magnetic headings when being vectored. However, in practice I found that dialing in a course and then making a correction based on the compass works well enough to make it irrelevant.
By the way - I think this is a GREAT AP once you learn how it works in all circumstances.
Cheers,
Bill Reister