I added rebuilding taxes for tax included tickets for next update. On next 5.1.61 refresh create a backup and execute Program Settings > Maintenance > Rebuild Tax Transactions command and let me know if it fixes the issue or not.
There is a maintenance task that should solve your problems. Be sure you have latest version 5.2.23 and go to settings > program settings > Maintenance
But you can see that in the response emre gave above. So why have you not tried it?