AltHold and Position with Lidar and OptialFlow

Hi everyone.
I have mini drone for indoor flight. It without GPS, only lidar and optical flow sensor for position estimate.
In stabilization mode, it flies perfectly.
When switching to Althold mode, the thrust is reset to the minimum, and does not change when the throtlle stick moves. This is the first problem.
At the same time, the distance sensor readings in the Mavlink Inspector are reliable.
Data from Optical Flow is received, but when switching to Position mode, the message REJECT POSITION CONTROL is displayed. EKF2_AID_MASK 2. GPS disabled. PX4 1.11 master branch.
I have been trying different parameters for several days, nothing helps. What could be the problem?