As you noticed, checking for referencing a swapped model is in `_check_referencing_to_swapped_model`. I've cleaned `_check_relation_model_exists` in https://github.com/chrismedrela/django/commit/f2800277a6db47e75f513220339ef8c896cff0a7.