If you don't give a pin, they can seize your devices (Andrew Tate on his 1st visit to Florida said that he refused to give pin and they seized phone and laptop)
That seems like a wildly different scenario to me. The OP is about a guy who has not committed any crimes. Andrew Tate is a known predator and CSAM peddler, with an active warrant in several countries.
I'll take that risk. It's pretty unlikely, and if it happens, having to buy a new phone is not the worst thing in the world.
They can't keep them, you'll get the devices back. Use a temp phone in the mean time.
Sad that we have to accept this as a risk of international travel, but here we are.