To reproduce, comment out the "Rules::$purgeDisabledByTests = true;" line in UITest.php.
UITest will launch archiving for a year period. This will launch archiving for each month. Archiving finishes successfully and archive data for months with visited is present in the database. Then ArchiveSelector::purgeOutdatedArchives is called which deletes the new archive data. When year archiving continues, Piwik can't find the archive data for each month (since it was deleted), so it says there is no data.
In 6980299c2dd3b082c27f035884d36dba86b112c4: Fixes #4382, purge outdated archives after current archive is finalized.