Datapatch error patch XXXX: XML descriptor does not exist in either the file system or SQL registry

In one of the environments (19c) after successfully applying Oracle patches at binary level, the following error was thrown when datapatch command was executed:

so the tool was searching for an old patch that doesn’t exist anymore under $ORACLE_HOME/sqlpatch directory.

— Possible Solutions:

Possible solution 1: if the patch number XXXX is related to old java patch, then apply latest OJVM patch…you can execute the following command to check:
$ORACLE_HOME/OPatch/opatch lspatches

Possible solution 2: copy the missing patch folder from another database environment to this environment (the environment you are facing the error) , under this folder: $ORACLE_HOME/sqlpatch