it happens very often when working on a piece with multiple different odd meters that a bar doesn’t work correctly, for instance if I have a 21/16 bar, sometimes the bar works with only 20 sixteen notes. Is this kind of problem solved on Dorico 5?
It is not a problem to be solved. (There are numerous threads on this topic)
This is probably an over-simplification, but if you change a time signature, and there is already a later time signature in your score, Dorico does not add extra time to make complete bars, unless you have engaged Insert Mode (I).
Dorico only works in one direction with this. It won’t allow a bar with too many beats, but will allow a bar with too few. I’d really love some proofreading assistance with this, like request #7 here, but as of now it may be easier to dump an XML into Finale (Check Region for Durations) or Sibelius (I believe there is a script for this), use their proofreading tools to find the errors, then make the changes in Dorico.