KiDS-Legacy: angular galaxy clustering from deep surveys with complex selection effects