Probably caused by an add-on or import putting bad values in your collection. Try the following:
mw.col.db.execute(“UPDATE notes SET mod = CAST(mod AS INTEGER)”)
Please see Miscellaneous - Anki Manual
If it fixes the problem, you’ll need to force a full upload afterwards.