If we do not change CTE 'inp' and modify CTE 'person_nfo' (comment GROUP BY clause):
,person_nfo as
(
select n.id person_id,i.p2
from zzz_tbl n left join inp i on n.company_id = i.company_id
--group by n.id,p2
)