If you manually move the Z axis up and it just stops at 140 it probably firmware
eg in marlin it might have.
#define Z_MAX_POS 140
I don’t think there is any gcode that can over ride this
But you can test this theory
home your Z axis, I presume it homes to Z0
move the Z up 20mm
send a G92 Z0 (ie lie to the printer that its back at Z0)
now tell it to go up 140. It should go physically all the way to 160, and stop.
Not very useful, but proves there is a 140 limit in firmware