I have a valid US visa in my (expired) old passport. In my new passport the given name and surname have been swapped. Will I have issues traveling back to the US with this new passport, or I should I attempt to get a new visa?
So to clarify:
- Your old passport is correct
- Your old visa is correct
- Your new passport has it wrong
It's definitely something you'll want to do, to prevent problems. Yes, it'll likely be clear what has happened, but given how strict the US is - for their own passports, they offer a FREE, expedited service for correcting passports, which are prioritised well above general passport applications - they'll expect the same from other citizens.
Ultimately, it'll come down to the discretion of the US border agent to decide if it's clearly just a mistake, and even then they're likely to give you a telling off for trying to travel with an incorrect travel document.
You probably don't want to leave it up to them, so I'd recommend getting it fixed ASAP, before you travel back to the US.