There is an issue with incorrect package version handling in compiled code that leads to crash in PackageCompile'd apps:
JuliaImGui/CImGui.jl#187 (comment)
I think one workaround is to make pkgversion a macro or generated function, so it scans for Project.toml at parse time, when it is not thrown away by the PackageCompiler.