devicepairingexperiencemem.dll Error in Windows 10 and 11: Device pairing experience

A device appears in the add-device menu, but the pairing window closes before you can confirm it. If the message or log names devicepairingexperiencemem.dll, capture the full path, Windows build and time of the failure.
Microsoft binary metadata identifies this file as Device Pairing Experience contract implementation. Use the filename as a diagnostic clue and check the action that failed before repairing Windows.
Isolate the failure
Try one known-good discoverable device in Settings. Note whether the pairing prompt appears after the device is listed.
Repair the affected component
Move the device within range, check whether it is paired elsewhere, and follow the vendor's pairing instructions. Restart Windows before retrying the built-in dialog.
For a protected Windows file, use Microsoft’s System File Checker instructions when there is evidence of Windows component damage. Keep DLLs supplied by Windows or the full vendor package.
Verify the repair
The confirmation screen stays open and the known-good device connects.
See Microsoft’s guidance for this feature, the exact Windows file record, and the related PC Repair Atlas guide.