they don’t know your device is factory fresh unless you give them the code.
There is inconvenience of being deported but frankly risk of giving access to all clouds account to random official is just too high.
There is also risk of them putting you in jail but I am not sure if unblocking phone really mitigate it.
Still, give them the code if you want.
It's pretty unbelievable that you have reduced constitutional rights as a citizen re-entering the country.