Doesn't an eSIM link the SIM to the phone's IMEI which is usually logged somewhere?

Yes, eSIM doesn't really change this conversation