After the major version upgrade, check the result in three places: the events of the DB instance, its configuration, and the database itself. Then refresh the optimizer statistics, because pg_upgrade does not copy them to the new version.
When the Status of rdspg-lab-db is Available, open the Logs & events tab:

Open the Configuration tab:
default:postgres-18, In sync.
Connect to the App server (ssh rdspg-app), then run:
psql -d postgres -c "SELECT version();"
vacuumdb -d postgres --analyze-in-stages
vacuumdb -d pglab --analyze-in-stages
vacuumdb --analyze-in-stages rebuilds the optimizer statistics of each database, first quickly with few targets, then with full precision.
Do not run vacuumdb --all on Amazon RDS. It also tries to connect to rdsadmin, an internal database that only AWS can use, and fails with pg_hba.conf rejects connection. Run vacuumdb for each of your databases instead.
After a major version upgrade, also update the extensions you use with ALTER EXTENSION ... UPDATE;. RDS does not update them for you.