This is due to bad font design, in my opinion. Instead of letting
S overshoot its bounding box, the font developers decided to define a bounding box that vertically covers the whole inked area and has some sidebearings, as it becomes apparent when setting the parameter
\fboxsep to zero:
Note that both sidebearings of the italic
f are negative, whereas only the right sidebearing is negative for the upright
I don't know if this is an inherent limitation of OpenType fonts or just careless design: in a well crafted Roman font, all uppercase letters should have the same height and zero depth. Letters may overshoot the bounding box, but this overshoot should not be taken into account for determining the height and depth.
If you want a “capital letter box” macro, you can use an "I" as a model: