We investigate whether the Affleck-Dine (AD) mechanism works when the contribution of the two-loop thermal correction to the potential is negative in gauge-mediated supersymmetry breaking models. The AD field is trapped far away from the origin by the negative thermal correction for a long time until the temperature of the Universe becomes low enough. The most striking feature is that the Bubble parameter becomes much smaller than the mass scale of the radial component of the AD field, during the trap. Then, the amplitude of the AD field decreases so slowly that the baryon number is not fixed even after the onset of radial oscillation. The resultant baryon asymmetry crucially depends on whether the Hubble parameter H is larger than the mass scale of the phase component of the AD field, Mθ, at the beginning of oscillation. If H<Mθ holds, the formation of Q balls plays an essential role in determining the baryon number, which is found to be washed out due to the nonlinear dynamics of Q-ball formation. On the other hand, if H>M θ holds, it is found that the dynamics of Q-ball formation does not affect the baryon asymmetry, and that it is possible to generate the right amount of baryon asymmetry.