Your PHP is configured to stop running a script after some time, generally 30 seconds. When Matomo (Piwik) is used on a websites with few thousands visits per day, then this limit might not be high enough. To fix this, modify in your php.ini the max_execution_time value to zero (which means no time limit):
max_execution_time = 0
This will ensure that Matomo (Piwik) always has enough time to process your analytics reports.