Transient responses of the linear and nonlinear gap resonances in the fixed and free-heaving moonpools