it is intentional.
The way I inteded to do is to have the option to prestige (multiply xp gain) or defeat the flagship after the 4th sector (sector 5 boss/ending), or keep continuing further to next sector.