In divisions of 20 or more teams, it has happened 23 times in league history.
The joint largest is 3, in the Third Division in 1982/83. Reading were relegated with 17 defeats (only 5 at home) while Sheffield United finished 11th with 20 defeats (and 19 wins).
It has only happened in the second tier on 5 occasions, with 4 of those being a difference of one less defeat for a relegated side and one of 2. If neither or both us and Huddersfield lose, it would be a new record for the second tier.