It has to do with INSERT INTO statement when using ON CONFLICT.
Thank you for the report - though we prefer that bug reports be self-contained when sent to us.
This unexpected interaction between pl/pgsql and the on conflict clause is known to us (recent thread links below). There are presently no plans in place to make a behavioral change to this code; users are advised to use one of a number of possible work-arounds to avoid the reported ambiguity error.