Why are the number of lines per frame being incorrectly detected?
This happens if the the vertical sync (vsync) and the horizontal sync (hsync) do not change on the same cycle, then the timing controller detector could incorrectly detect one extra line per frame (e.g., if vertical sync changes one or more clock cycles before the horizontal sync changes).
This could also happen if the vertical blank (vblank) and the horizontal blank (vblank) changes do not change on the same cycle, then the timing controller detector could incorrectly detect one extra line per frame (e.g., if the vertical blank change one or more clock cycles before he horizontal sync changes).
Typically, these changes should happen at the same cycle, but there could be cases where they are not aligned.