I have an observation but not a solution.
When I started using v5.40 with my PICKit4, the real deal not a PKOB4 started kit, I encountered some significant strangeness. What resolved it for me was to use the IPE menu: Tools->Hardware Tool Emergency Boot Firmware Recovery
This method reverts the Atmel controller in the PICKit4 to a USB CDC serial device and allows the Microchip firmware to be loaded like it's the first time.
This process will show you how to get the PICKit4, SNAP, ICD4 and PICKit4 OnBoard device programmers in this recovery mode.
I have done with using the Windows OS, but I want to be clear:
I do not know that this will solve your issues with the MAC OS, PKOB4 and IPE tool.
Having no MAC OS to try this on I do not know what will happen. The worst case is that you will need a Windows OS with MPLABX v5.40 installed to run it the way I know works. Best case, it fixes your problem. Being a pessimist I suspect this will not be helpful.
If you try this please let us know what happens.