Confusion between average and rms calculation for power
The source of the confusion here is from the second equation you list:

$$P_\mathrm{avg2} = V_\mathrm{rms}\times I_\mathrm{rms} = \sqrt{\frac{1}{T} \int_{0}^{T} V^2(t) \, \mathrm{d}t} \times \sqrt{\frac{1}{T} \int_{0}^{T} I^2(t) \, \mathrm{d}t}$$

This equation is true under the assumption that both the voltage and currents are sinusoidal and in phase. The derivation works out that way, so it is a simple way to calculate average power under that specific circumstance. The instantaneous method you used is the general case, and should work under all circumstances.