F450 Frame Quadcopter not at all stable in position hold mode

I build up an F450 Copter and the specifications are Pixhawk 2.4.8 (not original) and the GPS + compass module is an M8N GPS module. The problem I am facing is that when I switch my mode to Position Hold mode the Quadcopter is not holding its position at all, sometimes it starts drifting to left, and sometimes it drifts back and forth means no position hold at all. But it maintains its attitude very well. When I normally fly the quadcopter it is stable and flies without an issue. I always check my 3D GPS fix before flying, I always get 10+ satellites and the Hdop value is 1. Also when I switch my mode to return to home, it never RTH instead it starts to drift in a random direction.
I want to know whether the problem is in my PIXHAWK or in my GPS module. I also have flown with APM 2.8 but I have never faced any such issue. Thanks in Advance for any suggestions

Have you calibrated your compass and verified it points the correct direction, I have seen GPS pucks with strange orientations.

Yes, I have successfully calibrated the compass (Pixhawk’s internal as well as external module compass). Do you think the external module i.e M8n GPS + Compass has become defective and need replacement? Or the issue is something else only ?

have you checked on mission planner that north is actually north.

yes definitely, I have checked the orientation in the mission planner. That’s why I am worried, Everything is fine in the quadcopter but nothing is fine when I set any mode related to GPS.

have you tried loiter?, if your sticks arent perfectly centered in poshold it wont hold position.

There was never an Original Pixhawk 2.4.8.

But anyway, post a link to a .bin flight log.