Most MAVLink commands are compatible. Unfortunately there is a small set of commands that are either ArduPilot-only or PX4-only.
Your issue is one such example - the c_uart_interface_example uses the PX4 OFFBOARD flight mode. To work with ArduPilot, the example would have to be changed to instead use the more generic GUIDED flight mode.
In GCS_MAVLINK_Copter::handleMessage we see the following different bits of type_mask being checked:
The latter macros are defined in include/mavlink/v2.0/common/common.h which tellingly does not have any set to 0x1000 == 4096 (MAV_CMD_NAV_GUIDED_ENABLE)!
This suggests the example code is broken for takeoff for all Mavlink platforms.