This is actually an exception that GDPR makes for storing data - companies can keep around some sort of record to "tombstone" users.
Sort of. GDPR is so woefully under-specified in some places, and general in others, it's really entirely up to the will of the regulators what would count as a violation.