Say you have an active session that is using package x
the package x is instantiated in the SGA and in PGA for this session.

Say another session runs create or replace on x

Next time the active session is calling anythying from x it gets this exception.
ORA-04068: existing state of packages has been discarded

Oracle says: something changed in this package, Maybe the global variable whose value you are storing in pga does not exist anymore.

Did you also bounce the DB when you recompiled the package?