What if I paid this june as the price was high and since july it was going down and I have to sell it in loss?

As in june I would not be sure that until when I would be holding those shares

Doesn’t matter what happens after June
If you have them until your khums date you pay the khums at the value on that date.