If you have LDAP name resolution PING doesn't report it correctly, instead listing tnsnames.ora even if it isn't used
SQL> ping pdb21a
Network service name mapping file: /opt/oracle/product/23c/dbhomeFree/network/admin/tnsnames.ora
Attempting to contact: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testserver)(PORT=1521))(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=pdb21a)))
compared to TNSPING
$ tnsping pdb21a
TNS Ping Utility for Linux: Version 23.0.0.0.0 - Production on 28-SEP-2023 23:58:48
Copyright (c) 1997, 2023, Oracle. All rights reserved.
Used parameter files:
/opt/oracle/product/23c/dbhomeFree/network/admin/sqlnet.ora
Used LDAP adapter to resolve the alias
Attempting to contact (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testserver)(PORT=1521))(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=pdb21a)))
OK (0 msec)
Also, if you ping a value that doesn't resolve, you get no message (error or success) at all.
SQL> ping does_not_exist
SQL>