If your bag fits in the sizer at the gate, you can take it on board, because its dimensions are within the rules your airline has set for carry ons. At least that is how it is supposed to work.
Passengers bring things that don’t fit all the time, and gate agents don’t enforce the rules until they do. But if challenged, the sizer is supposed to be a neutral arbiter. One passenger decided to take this to the extreme.