That is strange.
Couple of approaches -
Restore from backup. Besure that Balance Sheet and P/L accounts are marked correctly. Do the close again. Look carefully at the JE the close process prints out and see where the offset to all the P/L accounts is posted to. Troubleshoot from there.
Other option is to follow Customer Source Article: 857310. It tells you how to adjust beginning balances. BUT the issue will be that a balanced entry is required. So if one side is to your RE account, where does the other side belong?
You really need to figure out what account got hit instead of your anticpated RE account, no matter which approach is taken.
Very doubtful the Year End close entry was out of balance. But, its software.
Warren