Remove gaps between bars

How can I remove unwanted gaps between bars (see attached) and where do they come from in the first place?
best, Martin

You’ve inserted a Coda. If you don’t want it, select and delete it.

Aha, so the Coda-sign generates a gap. Thank you very much.
Isn’t it possible to avoid this behaviour when using the Coda sign?

Yes, there’s an option on the Repeat Markers page of Engraving Options to determine the gap for a coda.

Got it, fine thank you