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.