In my protein, there is one missing loop, 15 residues.
...
However, the loops added are too extended, even have bad contacts with
the other parts of the protein.
You are not doing any loop refinement, and are only building a single
model. That is extremely unlikely to sample anything close to the
correct loop conformation. You will need to employ loopmodel to optimize
the loop as per https://salilab.org/modeller/9.24/manual/node34.html.
Even so, 15 residues is a very long loop, about at the limit of what
Modeller's loop refinement algorithm can handle. You will need to do
extensive sampling of conformational space (by building multiple models
by setting a.loop.ending_model to a large value, perhaps 500 or more)
and then filter for the best models.