Jumping and capsule half height

I found out that if you are jumping with capsule half height being not 96(standing), it causes a bug if you want to land crouched. In order to uncrouch after landing, you get uncrouched only when you start moving. The workaround I did is as soon as player jumps and is crouched, I change half height to 96 (standing), and event on land if still crouching, change it back to crouched half height. The issue is that the collision of player being in jump and crouched is the same as standing, so theres no point to jump crouched. Why is jump function conflicting with capsule half height and how can I change it in the air?