Wrong values for end balance in General Ledger report

I have finally found where the issue was, and the wrong balance values were due to a damaged MPTT on my chart of accounts tree; the account 202-000 was wrongly associated to other accounts as its children.

The problem may have started back a few months ago, when I made some updates on my existing chart by adding, moving, and removing some accounts around. At that time I didn’t know the importance of the MPTT on this matter. So by setting the left and right field in account.account to 0 to force a MPTT update it fixed the problem.