This comment isn't quite accurate. The problem is that the consumer's profile changed, and there was an existing RepoProfileApplicability object that referenced the consumer's old profile that hasn't been cleaned up yet. We have a monthly task that looks for stale objects and cleans them out, and until that happens there can be dangling references.

I believe it is safe to remove these dangling RepoProfileApplicability objects here, since they reference profiles that no longer exist.