Investments transactions with type : buy and subtype : contribution actually represent two simultaneous transactions: a cash contribution (inflow) and the purchase of a security (outflow).
When an institution represents these two simultaneous transactions as a single transaction, it is more important to capture the outflow part of the transaction, as this is part of the transaction that indicates the security that is being purchased. Since buy transactions are always positive, the entire transaction is represented as an outflow. This is confirmed to be expected behavior.
This behavior may be confusing to users. If you wish to change how this type of transaction is presented to the user, you can add business logic to set a negative amount for transactions that match type : buy and subtype : contribution before the transaction is presented to the user.
For more information on these fields, please refer to our Investments API reference.