Thanks for reaching out to the Community, @vdkvdk.
If you don't mind, may I ask you a couple of questions to get a better understanding of why you're receiving this difference? Have you completed any reconciliations? Did you offset every debit with an equal credit? If you can leave me a Reply, I can better assist you with what you're facing. In the meantime, let me provide you some information on Retained Earnings in QuickBooks Desktop.
Retained earnings are your company’s accumulated and undistributed profits over the years. QuickBooks automatically transfers your annual profits, as calculated in the Profit and Loss, to the Retained Earnings Account at the end of each reporting period, where they add to the previous year’s ending balance. You can create Journal Entries to correct your books. Before doing so, I'd recommend consulting an accounting professional to get the best legal and accounting advice for your business type.
You can also try verifying and rebuilding your QuickBooks software to fix your corrupted company file. Before you proceed with the troubleshooting, please secure a backup of your company. Once done, you can now start to verify and rebuild your QuickBooks Desktop.
Let me if this worked for you! I'll keep an eye for your response. Have a beautiful day.