I think this is referred to as the Surinder Singh principle, here's more about it:
https://www.freemovement.org.uk/surinder-singh-immigration-r...
https://www.freemovement.org.uk/surinder-singh-immigration-r...
For me most interesting about this situation is, that most people I know, think they are EU citizens just because they live in an EU country. But that's not really true, until they executed their EU rights first.