I’ve had the same problem a occasionally without any Dropbox factor involved.
I ALWAYS import to library, so there’s no way the ‘leave files in place’ would be ticked on.
After importing from a card from a Lumix GH5S M2, I came back to the project the next day and files are missing as per OP’s description. And like them, when I reinsert the camera card and try to relink or consolidate, I can’t because FCPX is telling me there’s nothing TO consolidate and the files ARE in the library. But if I remove the card, they disappear again.
My only solution has been to delete them completely while card removed, and then re-import.
It seems to be an occasional corruption quirk, and in my case nothing to do with DropBox. It just happened a few days ago, but before that maybe once every few months (I do a lot of short form projects, so possibly like 1 in 40 or so affected). I’ve never worked out what causes it – it seems very random and I’ve just used the delete/reimport workaround.