I don't refer to the logical names, but to the physical names. The filenames of the new database can not be the same as existing filenames.
Because you use a backup of database Y the files will default probably be something like Y.MDF and Y.LDF. These files could allready exist as part of the existing Y database. Change the restore command to alter the name of the files to ABC.MDF and ABC.LDF.
** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **