The global concept of "resident for immigration purposes" does not exist in the law of nations, or in the domestic law of at least some countries. For example, the US has no global concept like this, contrary to what many webpages say. (The US has a variety of different residency concepts depending on the specific immigration context.)
I have to disagree with you - but I guess we'll agree to disagree!
Earlier, you seemed to be conflating Tax Act residency with what was being asked by UK Immigrations. Residency rules for tax purposes apply ONLY to tax statuses. They should never be confused with visa status or citizenship status. Being a resident for tax purposes does not entitle you to any legal residency status within a country. Likewise, being a non-resident for tax purposes does not exempt you from holding a visa or citizenship that entitles you to legal residency.
For example, though the IRS may demand that you file a tax return within the USA because you lived here, if you did so illegally, then USCIS can still deport you. Legal residency exists as a concept in US law, while tax residency exists as a separate concept according to the tax code.
The only time I would think that someone should answer that they are a "resident of nowhere" is if they truly have nowhere to return to (for example, because they are a refugee). This is why the OP encountered problems. Without intending to, she arrived in the UK and implied that she was a refugee - which a very serious claim to make. Of course, I'm in agreement that the officers involved were being obtuse - but with the current climate in the EU and its refugee issues, she was treading in iffy territory for them.