Squint enough and what the agent has said isn't quite wrong ... from a certain point of view. Since there is a separate set of inventory for codeshare flights - which may or may not be the same as the prime flight number - you could be said to be "buying from" [e.g.] JL when purchasing the codeshare.
Of course, that's not what most would understand from the given phrasing. Even if we gave the agent the benefit of the doubt on understanding, this isn't a good way of communicating the actual situation.