Digital low pass filter for DC offset removal

What is your reference text for the low pass filter? Are you looking at the continuous time mathematical form or the discrete time (“digital”) form?

Be assured that the filter does work. Here is Wikipedia’s explanation.
You have not copied the first line correctly, and that might be confusing you. The second line is not part of the filter, it is applying the filter’s output to remove the offset.