If the problem keeps occurring, you could try exiting LR and deleting the file "<catalog> Helper.lrdata" in the catalog folder. That caches folder information and infrequently can become inconsistent. LR will reconstruct that file when it restarts.
Yes there was clearly a technical glitch, if a restart makes any difference to the count.
But it is also worth mentioning for purposes of the forum that the count shown by the Catalog always denotes its own images, which is not necessarily the same thing as the files present on disk.
There may be 20 files currently in the folder so far as Finder sees that, but say only 15 were imported to LrC at the time, and then 5 of those were since culled out of the Catalog, so that the Catalog now reports 10 - but Finder reports 20.
Conversely if with those same 10, you create two virtual copies for three of these - LrC will now report 16 and will be correct to do so. Because that's how many independently editable 'thumbnails' are seen inside LrC..
Also LrC may reflect some filtering, or stacking, which has suppressed its display of certain images whether master copies or virtual, which would otherwise have showed.