Autopilot A320 neox loses course

Press CLR on the MCDU, then the button at the side of the discontinuity and it should go. This works 90% of the time.
Occasionally one cannot be deleted - usually when an arrival link is not connected. Then leave it in place until you arrive at it in flight and then use the direct to (DIR) method, selecting the first point after the gap.
Let me know if that works for you.