scriptPubKey scripts no longer contain public keys.
They can and they do. What you should've said is that they are no longer as common as early days (that is until Taproot becomes common).
The old types such as P2PK are standard and can be used, P2MS is another script type contains multiple public keys, there are nonstandard scripts that contain public keys.
And finally the newest script types used in Taproot scripts contains the x-only public key.
These are the most recent P2PK transactions with the most recent from 2021-12-31:
https://blockchair.com/bitcoin/outputs?s=time(desc)&q=type(pubkey)#f=transaction_hash,type,timeKeep in mind that blockchair shows a P2PKH address by mistake, if you check the raw transaction you see the actual script is a P2PK one.