This is slightly complicated, because potentially there are up to three carriers involved (actually there can be one more but I won't get into that).
- The "operating carrier". This is the airline that actually operates the flight. Sometimes we use the word "metal", for instance, this is a BA metal flight if it has a BA logo printed on the outside and people in BA uniforms on the inside. (Sometimes the flight is actually operated by a subsidiary company under the control of the operating carrier, but let us not dwell on that complication.)
- The "marketing carrier". This is the company that marketed the flight to you. It is the company that appears on your itinerary and on your ticket. It could be the same as the operating carrier, in which case we can refer to the "prime" flight number. However, if it is a different company, then this is a codeshare. In your example, American Airlines is the marketing carrier.
- The "ticketing carrier". This is the carrier that actually issues you with a ticket. Normally this will be one of the marketing carriers on your itinerary, usually the first or the one marketing the longest leg on the journey. It is the carrier responsible for collecting payment and distributing it to the other carriers on the ticket. Sometimes we use the expression "validating carrier", which is because this carrier is responsible for validating the itinerary is correct and properly paid for. We may also use the expression "plating carrier", because in the old days of paper tickets, a big old metal plate with the airline's name and code number was used to stamp the carbon paper tickets. There is only one ticketing carrier for the ticket, but there can be many different marketing and operating carriers mixed in.
As you note, if you buy the ticket from AA.com, even for a BA metal flight, then the ticket is "owned" by AA, because AA is the ticketing carrier. The ticket is a financial document with monetary value (even though it's all electronic now). BA cannot touch an unflown ticket issued by AA, even if it concerns their own flights*.
However, once the ticket falls under "airport control", which it does 24 hours before departure, then the operating carrier has some ability to modify the ticket, but it is difficult and many of the staff at BA are not trained to use AA's system. In your shoes I probably would have insisted that BA fix their own mess rather than trek over to the AA terminal, but that is a matter of experience.
As you suspect, BA may treat its own ticket holders better than those ticketed under a codeshare. Actually I highly doubt BA does this with AA tickets, because AA and BA are very close partners in a special agreement to cooperate. I think you were just a bit unlucky. However if you were on a Lufthansa ticket with just a short domestic feeder flight on BA in the UK, I expect you would be told to go and find Lufthansa.
The main reason to book onto a codeshare is (a) price and (b) frequent flier benefits. For instance, I try to book as many flights as possible under BA numbers, because I get more points for this than AA flights.
*Actually AA and BA do have special authority to tamper with each others tickets, but this is unusual in the airline world: and they will not do this unless you are commercially important to them.