I have not seen this problem, but had similar discrepancies in the past. I try then to run php tools/upgrade.php check and php tools/upgrade.php upgrade - this applies potentially missing migrations to the database. But MAKE A BACKUP BEFORE - in rare cases this can mess up your database.