Most of this code is unnecessary. You’re attempting to convert a URL to a path when you could just use the function that returns a path.
$path = get_theme_file_path( 'archive.php' );
if ( file_exists( $path ) ) {
echo 'File Found: '. $path;
} else {
echo 'File Not Found: '. $path;
}