Why is the tax different for a transaction line of another accounting segment?

Accounting-related setups can affect tax calculation. For example, tax rules are sometimes based on the Accounting determining factor class. In such cases, changing or creating a distribution may affect tax calculation.

You can avoid this. All you have to do is select the Enforce tax from account option for the configuration owner and event class. Doing so makes the application use only the tax account information associated with the transaction line. As a result, any defined account-based direct tax rate rule gets precedence over any other tax rules.