Why do airlines even need separate flight numbers for codeshare flights? Why not just use the flight number of the operating airline in the booking? IMO it's just confusing for passengers as well.
The marketing carrier, aka the one with the airline code on the ticket becomes liable for certain things in most countries. Codeshare is one way who is responsible is known to outside parties immediately. It also impacts automatic luggage transfers for layovers.
Not to mention, there are bits where if I buy a JAL ticket for AA internationally, I get 2 free checked bags while the same AA sold and operated flight has no free checked bags. The JAL code lets the airline systems quickly determine they can't force you to pay up at the luggage drop-off because you are under the other carrier's rules for the flights.
A lot of this is based on the pre-smartphone age but I don't think there's better solutions that are both computer, person and policy friendly either.
Most airlines already have vastly different baggage rules for different seat classes so I doubt this really needs to be determined by the flight number.
I feel like you have it backwards: that's exactly the point. You buy the flight under the code share flight number, and you buy the seat class based on the code share airline's (not the operator airline's) seat class name. Then the code share airlines baggage rules for that seat class flow into that.
I think the answer is due to money and pride. My guess is that the issue is billing and international relations. Code shares aren’t (often) between airlines that are from the same country. So, if you have a requirement to fly a particular flag carrier, you have greater flexibility. For example if the ticket is funded by the US gov’t, you can still take an Air France flight, but get billed by Delta. Or, for frequent fliers (whom airlines love to target with rewards), you can have miles accumulate with United even if you are taking an Air Canada flight.
But I would think that this change could be made on the backend much easier than trying to add another number to the flight IDs.
I mean sure, but all that branding will fall apart once you board the plane and the livery, and everything else is branded by the operating airline anyways.