Trouble trying to serialize JuMP Models to .mps, .lp, .rew formats

I read
Gurobi AddGenConstrPoly() in JuMP

Since my main objective is to solve these models to solve using Gurobi, but trying to solve this JuMP model directly with Gurobi.Optimizer generates the same error.
Is there any way to bypass this error by working with Gurobi C api during direct_model()?
I tried:
model = direct_model(Gurobi.Optimizer())
instantiate model(filepath, model) #To load the model
JuMP.optimize!(model)

It runs and log indicate that Gurobi is being used, terminal status is 1 but objective function is zero.

“Barrier solved model in 0 iterations and 0.01 seconds (0.00 work units)
Optimal objective 0.00000000e+00.”

The model works perfectly well with Ipopt and other solvers.