Having difficulty triggering a landing in Offboard mode

I am trying to use my laptop as a flight computer to control my quad-rotor in offboard mode. I can successfully take off and send the position setpoints, but I am unable to land the quad.

I start off by sending VISION_POSITION_ESTIMATE messages at a rate of 10Hz to the drone. Then I send a stream of SET_POSITION_TARGET_LOCAL_NED messages at a rate of 4Hz to the drone.

Here is the tricky part though, whenever I use the “hidden” bits in the type_mask parameter for takeoff (0x1000, see: Offboard automatic TakeOff / Landing using MAV_CMD_LAND/TAKEOFF_LOCAL - #6 by patrick_smith) it will not takeoff and gives some warning:

[commander] Failsafe enabled: no RC and no offboard

but if I do not set that bit, and just use the following bit mask: 0b111111111000 it will work as I proceed through the following steps (note that I am ignoring every field except the X,Y,Z position for now).

Next, I put the drone into offboard mode by sending COMMAND_LONG with MAV_CMD_DO_SET_MODE with param1 = 209 and param2 = 6. Sometimes this gives a warning:

WARN [mc_pos_control] Offboard activation failed with error: Activation Failed
WARN [mc_pos_control] Position-Ctrl activation failed with error: Activation Failed
WARN [mc_pos_control] Altitude-Ctrl activation failed with error: Activation Failed`

But it will takeoff after I arm the drone and set the Z position to -1.

Once it is in the air, I cannot get it to gracefully land. I have tried using the 0x2000 bitmask with the type_mask but it just gets ignored whenever that is set.

I have also tried sending MAV_CMD_NAV_LAND_LOCAL or MAV_CMD_DO_LAND_START and neither of those trigger the landing.

Do I need to switch out of offboard mode to trigger a landing?