The system functioned as designed. The ground proximity alarm sounded and the pilot in command took control.
It's possible the pilot should have refrained from engaging the autopilot during initial climbout. Pilot workload is high at that point in a flight, and fiddling with gadgets is distracting. Maybe wait until passing through 5,000 feet?