Problems with slow or buggy right-click functions are virtually always caused by faulty third-party software (so-called shell extensions) that inserts entries into the context menu of a file item.
To verify and work-around the above, do this in XYplorer:
Then retry right-clicking the same file that caused the error. If the problem disappears, you need to find out which particular shell extension is the culprit. One way is to disable these shell extensions one by one using the free ShellExView program:
ShellExView - Shell Extensions Manager
If you found the culprit keep it disabled.