Duplicated id error, key is actually NOT duplicated
You're trying to insert the same id twice, because MAX(id) doesn't get incremented until commit. What you want to do is precisely what the DEFAULT does on passport

id integer NOT NULL DEFAULT nextval('passport_id_seq'::regclass),


Hint: nextval(seq)

It'll look like this,

INSERT INTO passport (
    id,
    public,
)
SELECT
    nextval('passport_id_seq'::regclass)
    TRUE,
    ...


But even better because id has a DEFAULT just remove it entirely..

INSERT INTO passport (
    public,
)
SELECT
    TRUE,
    ...