Try Adobe Bridge (use the view menu to show hidden/invisible files).
An OS command line CMD.exe or PowerShell command code should also be able to delete such files if the Windows GUI has an issue.
An Adobe script could do this, but it sounds like a problem with your operating system, not an Adobe Photoshop or Bridge bug.
/*
Delete All XMP Files in Selected Folder.jsx
v1.0, 22nd October 2023, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-bugs/can-t-delete-xmp-files/idi-p/14176544
*/
#target photoshop
var theInputFolder = Folder.selectDialog("Please select the folder containing the XMP files to delete:");
if (confirm("USE AT YOUR OWN RISK!\rDo you really want to permanently delete all .xmp files at the top-level of the selected folder? There is no undoing this operation!")) {
var theInputFiles = theInputFolder.getFiles(/\.xmp$/i);
for (var i = 0; i < theInputFiles.length; i++) {
theInputFiles[i].remove();
}
}
app.beep();
theInputFolder.execute();