In the Battle of Endor, the unfinished Death Star II was firing its superlaser at the Rebel capital ships while the ground team was still trying to disable the Death Star's shield. Which means the shield was still operational.
In multiple films (e.g. The Emptire Strikes Back, Rogue One), we've seen that both energy and projectile weapons are generally stopped by shields. In Rogue One, we've also been told that
a shield works both ways, i.e. that it's impossible to get out through a shield as well as impossible to get in.
That leaves me wondering: how was the Death Star able to fire through its shield while still being protected by it? Is there an in-universe explanation?