"Sharing" trophies between PS4 and PS5

I'm playing this game both on PS4 and PS5, and realise that the two versions have separate trophy registrations since you can also install and play the PS4 version on a PS5.
Does that mean that some of the trophies may only pop on one of the versions (for instance the exact moment you buy a legend car) , or will the game remember the trophy gain and pop it on the other version once you start it?