climb to say FL180 and then compare the GPS against the altimeter reading
Well, yes, a baro altimeter is going to be pretty useless for determining actual heights, when at high altitude, due to a virtually permanently nonstandard atmosphere.
I have never seen the inside of a real altimeter but believe it contains some kind of logarithmic correction, but that will be a 1st order one only, with the OAT not being measured, never mind corrected for.
An altimeter reads accurately only on the ground, after you have set it to the known elevation of the ground
Once airborne, it is OK for vertical separation of traffic provided everybody uses the same sort of instrument (which they do).