Why Gibbs free energy is equating to 0?
That is not the Gibbs Free Energy at constant pressure and temperature.

Alphabetic soup definitions:


$G$ - Gibbs free energy
$H$ - enthalpy
$T$ - temperature
$S$ - entropy
$P$ - pressure
$V$ - volume
$w$ - work
$q$ - heat
$U$ - internal energy


Definition of $G$ is $$G = H - TS$$

Definition of $H$ is $$H = U + PV$$

The total differential of $G$ is 

$$dG = dU + PdV + VdP - TdS - SdT$$

The definition for the change in $U$ is $$dU = dq + dw$$

There are two kinds of work: pressure-volume work (pv) and non-pressure-volume work (non-pv)

$$dw = dw_{\mathrm{pv}} + dw_\mathrm{non-pv}$$

Thus, substituting we get

$$dG = dq - PdV + dw_\mathrm{non-pv} + PdV + VdP - TdS - SdT$$

If the process is (approximately) reversible:
$$T =\dfrac{dq}{dS}$$

Substituting $q = TdS$ and simplifying, we get:

$$dG = VdP - SdT + dw_\mathrm{non-pv}$$

At constant pressure, $dP=0$, and at constant temperature $dT = 0$.

Therefore:
$$dG = dw_\mathrm{non-pv}$$

Hence, Gibbs free energy is sort of a measure of useful work we can get out of a system. 

$$w_\mathrm{non-pv\ by\ system} = - w_\mathrm{non-pv\ on\ system}$$