I had exactly the same issue. Tried 4 different SIMS from family members in my A51 5G and none would work, must be the phone, right?
Called Samsung support and paid £20 for the WeFix service, they come to you under warranty and sort within an hour.
Only thing is that after 2.5hrs, the engineer could not get the A51 5G to work on my SIMS, just his O2 SIM!
I had to phone Samsung 5 times to get another engineer visit sorted.
The night before the visit, I was once again googling and found this page to add the APN. I must stress, I did contact Vodafone and they sent me a brand new SIM, delivered the next day, same no data result.
I added the APN as per this website and it just worked:https://deviceguides.vodafone.co.uk/samsung/galaxy-a51-5g-android-10-0/connectivity/set-up-your-phon...
I managed to work out that the config message being sent by VF to the device is not being implemented accurately as it's adding a proxy server address where one's not needed and a port ID.
Try the above as mine is now happily flying on 4G.
Good luck 🤞