Hi,
This is not possible to cancel a click on the modal transparent black background (cf. WCAG 2.5.2 "Pointer cancellation").
I think this is because the background is on a container of the modal window, so even if you move the pointer from the transparent black background to the center of the modal window, it will close the modal window. But I let you investigate to find the good solution to fix it.