In my system it changes as well the company code if I enter the plant that belong to a different one that entered in the header (and it is the only line item). I would not even enter the company code manually at header level, as it automatically defaults from the plant in the first item.
So I actually do not really know why you want a different behavior or even an error message.
What is the background for this request.