The trading giving me less than i paid?

I dont know is it just me or not, but while i was returning to my settlement, i decided to buy some creates because their destination was my planet. I paid 500 C and and took the crates, i returned and when i sold them, it didnt give me the money i paid + profit, (which is like 700 or something) it just gave me the profit (200ish) and didnt give me the money i paid, is that a bug or is it about the tax stuff?

It’s probably just part of the crates being completely randomized where you have a chance to loose money when doing a crate run