Tommen's declaration to the High Sparrow — "I am the king!" — directly mirrored Joffrey's inexperienced attitude.
Tommen confronted the High Sparrow, and at one point told him "I am the king," when he felt ignored. Back in season three, Joffrey threw a mini fit at a small council meeting. When he declared "I am the king," Tywin told him "Any man who must say 'I am the king' is no true king."
Given this context, viewers could see clearly that Tommen is struggling to truly rule over the kingdoms. Joffrey's attitude was similar, and look where that got him.
In a way, this statement foreshadowed Tommen's eventual death, though many were shocked when he comitted suicide in the season finale.