The Office was a hugely successful show for many years, but it definitely went downhill in later seasons. There are a few reasons why this might be the case.
For one, the show started to feel very formulaic. Every episode seemed to follow the same pattern: someone would do something stupid, there would be a series of awkward conversations and then someone would make a hilarious comment to lighten the mood. While this worked well in the early seasons, it got old fast.
Another issue was that the characters became less relatable as time went on. In the early seasons, we could all see a little bit of ourselves in the characters. But as they became more successful and their lives became more enviable, it was harder to identify with them.
Finally, The Office lost its edge as it became more popular. When it first aired, it was groundbreaking in its use of mockumentary-style filming and clever humor. But as imitators popped up and other shows began to experiment with similar formats, The Office started to feel like it was just going through the motions.
So while there are definitely some factors that contributed to The Office's decline, at the end of the day it just wasn't as fresh or funny as it used to be.