Had something similar happen, with repeated "ERROR: AcceptBlockHeader: block ... is marked invalid".
It was on Litecoin Core 0.18, not Bitcoin Core, but the fix was the same.
The only strange thing that had happened in proximity was a previous out of space crash for the cachestate.
But a following run did sync new blocks for a minute or two, before hitting "marked invalid", so maybe it was unrelated.