You can see more information at: http://www.learn-english-today.com/lessons/lesson_contents/verbs/inversion.html . I think that it is only a common grammar rule.
After 'seldom', 'rarely', 'never', in comparisons : - Seldom have I seen such a beautiful view. - Rarely did he pay anyone a compliment. - Never had I felt so happy