If parent form isn't visible code from r59186 raises exception.
if Assigned(CurPage) and HasFocusedControl(Page[FPageIndexOnLastChange]) then
CurPage.SetFocus; <<< if form isn't visible we are dead here. Must check if form is visible before trying to set focus to the CurPage.

Steps To Reproduce

Create form with TPageControl and two TTabSheets, set active page to the first one, in OnCreate of form set TPageControl.PageIndex := 1; -> error