function scope behaves differently on local job

Can you provide a minimal REPRoducible EXample (reprex) illustrating your issue?