Dramatic altitude change in Position Mode

I built my own quadcopter with a Pixhawk PX4. I was able to fly it sort of successfully a few feet off the ground in Stabilized mode, but when I switched to Position Mode and moved the throttle stick up slightly the drone shot about 100 feet into the air and wouldn’t not come back down when moving the throttle stick all the way down.

The first time I was able to recover it by switching it back to Stabilized mode, but the second time it ended up in a pond.

Any tips on how to avoid this in a future build?