Be a moon
This was initially an afterthought but as I developed the idea I thought it was so good that it deserved to be the first item.
You could design an earth-distance gas giant and a habitable moon with a mass higher than the local hydrogen-accretion limit, then your higher-mass gas giant would consume all of the locally available hydrogen in the early solar system as well as any of the planet's atmosphere which made it's way outside of the planet's roche lobe. In order for this to work without destroying the planet it would need to remain outside the roche limit but within the significant gravitational influence of the companion gas giant. Basicslly you could have a habitable planet of practically unlimited mass & therefore practically unlimited atmosphere density which far exceeds the mass required for runaway hydrogen capture in a normal planet.
The more massive the habitable planet compared to the host, the closer the roche limit would be, the steeper the gradient would be between the beginning of roche lobe atmosphere transfer and exceeding the roche limit altogether. The ideal conditions for non-destructive roche envelope transfer would require the habitable planet to be of much lower mass than the host and to orbit at a distance where the gravitational gradient is quite shallow. This could be addressed by making the host a substellar object of up to 80 Jupiter masses which is about as big as it can get without becoming a star.
If this works then it would put a hard limit on atmospheric density and allow you to exceed the hydrogen accretion limit by any amount you wanted just by varying the mass of the life-bearing planet and it's host / or the orbital distance between them.
The host planet has the potential to become a deuterium star between 13-80 Jupiters, meaning you might have a binary star system for a few million years. The solar wind from the deuterium star would also have an atmosphere-stripping effect on the orbiting planet. It might also sterilise the planet if it were close enough to be within the roche lobe transfer limit so this is likely to be an either/or scenario (either roche transfer or solar wind). Maybe the deuterium star burned out early in the planet's life cycle and it then settled down to be a roche-transfer system / or captured the habitable planet after the deuterium burning phase was over.
The planet will almost certainly be tidally locked to the host and you would get one day per each orbit of the host. It's probable that such a planet would have increased volcanic activity as a result of tidal heating & if the planet were too close to the host it could still be made uninhabitable by tidal heating.
How to actually calculate it
An easily pluggable equation for calculations of the roche lobe size of planets does not seem to exist. There are some calculators which rely on lookup tables for stars (https://github.com/denisleahy/roche-radius-calculator) but the computations of individual roche lobe size appear to rely heavily on real-world observations and as there is no such object available for us to observe we would need to use creative license or do some speculative math based on the roche limit and atmospheric density.
In order to roughly estimate the roche lobe for an exoplanet, perhaps you can calculate the atmospheric density (https://www.mide.com/interplanetary-air-pressure-at-altitude-calculator) at varying altitudes and plug these densities into a roche limit calculator (https://calculator.academy/roche-limit-calculator/)
The density at which the roche limit is exceeded would be the atmospheric altitude at which atmosphere will be stripped away from the planet. In the real world this atmospheric stripping will effect the density of the atmosphere at lower levels giving rise to complicated interactions between roche envelope & atmospheric density.
Magnetic field interactions
This is further complicated by magnetic field interactions. For a start the host planet's magnetic field is strong enough that it completely diverts the solar wind before it reaches the planet so solar wind interactions are not relevant anymore, instead there are host-moon interactions.
If the host magnetic field is strong enough to form a combined field with the moon then charged particles from the moon will be directed into the host magnetic field even from within the roche lobe, but if the habitable moon has a strong enough magnetic field of it's own then this would divert escaped ions along the moon's magnetic field lines. The moon probably pumps a massive number of charged particles into the host's magnetosphere & there would be a polar wind driving atmosphere escape from within the planet's magnetic field, the moon would probably eject plumes of charged particles from it's poles. In this case particle escape would also be determined by magnetic interactions / the shape of the combined magnetic field.
At the moment this is just a nascent idea and it may turn out to be impractical, I might be back later if I can actually work it out.
Just change the starting conditions
Atmospheric pressure on an earth-like planet at an atmospheric depth of 150 miles (1.5x current surface depth) would be > 3 atmospheres. All you would need is less starting water to fill some deep parts of the surface.
Air will escape, but the speed at which it can escape is limited not just by the mass of the planet but by the strength of the solar wind which for an earth-like planet is not significant enough to result in the substantial escape of heavier elements.
If you start with more air, particles such as oxygen and carbon will not be easily dislodged by the solar wind and will mostly accumulate in the atmosphere or via sequestration into dirt and rocks.
According to some models the core dynamo creates an electromagnetic shield which prevents the solar wind from energising the upper atmosphere & reduces the number of particles which can escape.
It has been shown that atmospheric escape may not be heavily incluenced by magnetic field: https://www.aanda.org/articles/aa/pdf/2018/06/aa32934-18.pdf
But this does not seem to have been modelled with alternate (ie entirely fictional) planetary configurations.
This one is tricky. Earth is near the upper range for a water-retaining planet, much cooler or much larger and it will begin to accrete hydrogen = gas giant. In order to defeat this the planet will need to have a higher surface temperature, meaning it will need to be closer to the Sun. The closer to the Sun you get the more massive the planet can be without accreting hydrogen, but you again have the problem of water retention.
The reason why much colder worlds such as Io and Titan have not become gas giants is most likely their close proximity to gas giants, so the conditions on these worlds is not necessarily a useful model when considering a free orbiting world unless you want to be in orbit around a gas giant (goto 10)