But some of the energy must be used to cycle the action, reducing the forward pressure of the gas?
The cycling energy is mostly recoil energy which happens anyway - instead of just pushing the rifle back, the energy pushes the bolt back first.
Gas operated systems (non-rimfire) are a bit different but they only draw a very small portion of the gas off, and have negligable effect on loss of velocity.