Drone not reaching the specific altittude using set_position_target_local_ned

Hello Everyone,

I want to know the difference between these two commands "set_position_target_local_ned() vs MAV_CMD_NAV_WAYPOINT ". How do they differ in terms of functionality?

So, I was controlling my drone to go to a specific location using set_position_target_local_ned() after flicking into guided. After flicking into guided, the drone is not going to the desired goal point which is 20 meters above the current altitude. What could the reason? Do I need to use any other commands instead of this ? Here is what I am doing code wise in Rust

pub async fn stop(&mut self) -> Result<()> {  
let pos_absolute = Vector3::new(self.vehicle_state.rel_x,self.vehicle_state.rel_y,self.vehicle_state.rel_z-20.0);
 self.set_position_target_local_ned(pos_absolute,yaw as f64).await?;
 Message::MavMessage(msg) => {
                            match msg {
                                MavMessage::common(ref cmsg) => match cmsg {
                                    MavCommon::HEARTBEAT(heartbeat) => {
                                        if heartbeat.system_status == common::MavState::MAV_STATE_UNINIT { continue }
                                            match heartbeat.custom_mode {
                                                20 => {
                                                5 => {
                                                    //Do nothing in loiter
                                                    println!("Heyyy, I am in loiter mode");

                                                _ => if self.drone_state.mode == 20 {
                                                    self.release().await? ;

So, in this case, as soon as I flick in Guided , heartbeat = 20, stop function is called and the command set_position_target_local ned is called as shown in the code. But the drone is not going to that specific point as desired. It hardly moves in cms , like 20-30 cms.

Thankyou for help.