Power transfer in transformer
The mistake you made was in pre-defining the primary current as 2 amps. You broke ohms law at this point (retrospectively).
If there is 6 amps flowing in the secondary due it producing 30 volts across a 5 ohm load then clearly, there is more current in the primary than what flows in the secondary hence, your figure of 2 amps is wrong.
$$I_1 = \dfrac{V_2\times I_2}{V_1} = \dfrac{30\times 6}{10} = 18$$
Primary current has to be 18 amps.