Reporting API date range problem

There are no errors in my PHP error log and requests do not timeout.
There is another post that reported a problem similar to mine Date range gives wrong data - #14 by heurteph-ei I tried all suggestion for there and it does not help.
I am currently using Matomo 4.12.0

Here are some screenshots from Matomo dashboard


As you can see, according to Matomo there are Events from 04/01/2022 to 06/30/2022

But


there are events from 04/01/2022 to 07/02/2022

However here is the number of events from 07/01/2022 to 07/02/2022

As you can see, they do not add up to the total number of events from 04/01/2022 to 07/02/2022

How can this problem be fixed? What do I need to do?

Please help.

Thank you.
Alla