A tip for those who are worried they may be in a similar situation. This is based upon training at previous jobs as well as helping journalist friends out:
Do not take a burner and do not take a blank device through a border checkpoint (what customs essentially is). You have VERY murky rights in those situations and there are plenty of legal carve outs (in many nations) to essentially throw you in a black site under suspicions. And someone having a factory reset device is right up there with "These students aren't interested in learning how to land a plane" for red flags.
If you have sensitive information on your devices? Remove that ahead of time. Look into methods where you can access it remotely (VPNing into a remote system being the easiest). You want to be able to wipe and recover your device when traveling...
Hell, even if you aren't concerned about protecting sources for a story or concealing your sexuality, it is a good "point" to reach. Because pickpockets exist and your phone could get stolen or even destroyed.
So problem solved. Wipe your phone while you are taxiing and recover it on the cab ride to your hotel! No, don't do that. Because if you get inspected you are raising ALL the alarm bells.
Instead, get into the habit of having a minimal state phone. It is one of the many reasons I discourage people from actually deleting those Facebook accounts (aside from it meaning you no longer have any "right" to images that are tagged as the numeric identity that just happens to be you...). Having a facebook account you haven't posted on in a decade but still keep to get notifications from the local parenting group is a perfectly normal thing. Having a dating app on the phone (assuming you don't have to conceal your sexuality) is a perfectly normal thing to do. Same with having a reddit or an instagram where you thirst after Benedict Cumberbatch's feet. And so forth.
Which is the reality. While this is straight bullshit... it also kinda isn't. If someone is traveling internationally with a fully wiped phone (bonus points for apparently deleting it while customs were trying to get into it...)... that is gonna put you on a watchlist and.. they probably aren't wrong to do so.
Think of your personal devices as being like your car. Some stuff you just toss on the floor of the back seat and cover with a blanket so it isn't super visible from the outside. Other stuff you just don't leave unattended in your car, period. And... if every time you borrow a car you get it fully detailed and change the upholstery... folk are gonna be wondering just how many bodies you have driven out to the desert in that.