I found the reason for the problem. Perhaps you explain its nature. The steps motors of the axes A and B had 6 wires 4 of which were sweaty to the controller. After replacing the engines with 4 wired problems did not appear.

Best posts made by Stanislav
-
RE: PanelDue 7 loses macros after homing or moving rotary axes A/B