Eventually you hit a limit where you simply can’t create enough pressure to propel the projectile faster and not turn the barrel into a pipe bomb.
For the most part many guns have already hit their practical limit in this regard.
There is a good reason why battleships fell out of favor other than the US being the only blue water navy after WW2.
Those big guns are a bitch they are slow to reload and you can’t be anywhere near the muzzle including good couple 100 yards of the bow of the ship when those fire.
Also powder takes up space and weight, takes time to reload and it can explode when ignited.
Having a gun with parts that don’t explode intrinsically when set on fire is a pretty big advantage for any combat vehicle or vessel, not needing to carry propellant for your rounds is also a huge plus because you can carry more rounds or other munitions and supplies.