There are various negative adverbial constructions that take subject/verb inversion when they come at the beginning of a sentence or clause, and this is one of them.
Never did I ever imagine this would happen.
Scarcely had he arrived than he said he had to leave.
Seldom is this rare bird seen in the wild.
On no occasion has this ever happened before.