My default position is to avoid code shares where possible because any problem seems to have you being sent from pillar to post.
There are advantages. For example my child often needs the BA flight numbers to maintain status so it’s worth the risk. Sometimes work offers me a CX flight to HKG on AA number which gives more Avois but a seat selection headache (phone call usually required).
I think the new long haul hand baggage only fares have also opened up a few more sweet spots for code shares. But generally having a ticket issued and marketed by the operating carrier makes life easier when things go pear shaped or even during routine events like schedule changes.