Code compiled with PackageCompiler allocates more

If I compile some code with PackageCompiler and then run

julia> v = [1,2,3,4];
julia> q = view(v,1:2);
julia> @time collect(q);
  0.000108 seconds (33 allocations: 1008 bytes)

while if I do the same in the standard Julia REPL I get:

julia> v = [1,2,3,4];
julia> q = view(v,1:2);
julia> @time collect(q);
  0.000015 seconds (1 allocation: 80 bytes)

The same discrepancies seem to affect other similar cases. This easy one is provided for MRE.

PackageCompiler was run with the arguments:

Cmd(["--strip-ir", "--compile=all", "--strip-metadata","--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"])

PackageCompiler v2.1.17
Julia v1.10.0
MacOS 14.3.1