It is not at all unusual for codeshare availability to be subject to married segment rules - i.e. only available when connecting to or from that airline.
To switch a flight from operating airline to codeshare you need the codeshare to exist, availability on the codeshare, and meet any rules (such as married segment) that applies to the codeshare.