Many code bases change font size depending on what breakpoints are hit in their application. When clamping text on a window resize you should remeasure the line height of the text as it could have changed.
As an example in our application the font size is smaller on mobile so we end up with a clamp of 3 lines perfectly at desktop, but if I resize my browser to make it smaller then the clamp is 4 lines.