The scenarios you’ve posed doesn’t make candidate 2 any less replaceable. Maybe candidate 1 is needed for whatever advanced AI the dating app uses, but there’s many non-foreign options for the function candidate 2 is performing at ImportantCorp.
Yes, super subjective, but that's the point - it would be difficult to account for these things in the law.