RMAN-06004: Oracle error from recovery catalog database: RMAN-20005: target database name is ambiguous

When trying to duplicate a database, the following RMAN errors occur:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/29/2025 16:01:38
RMAN-05501: aborting duplication of target database
RMAN-06004: Oracle error from recovery catalog database: RMAN-20005: target database name is ambiguous

RESOLUTION

RMAN> SET DBID=123456789;
RMAN> DUPLICATE DATABASE....