I think, too, that he sinned by taking the credit for the miracle on himself. He probably was so angry and so worn out that he just didn’t think. But God says he shares his glory with no one. Moses wasn’t capable of making water come out of the rock.
I think his major sin was taking credit [pride] for the miraculous provision of God. Also he reminded me of the heart of Jonah he was upset with the people and grudgingly struck the rock with anger. These were good verses to ponder as pride , anger and entitlement are a struggle for me.
Could you provide a reference for that? I'd like to see it in context because John 17 seems to send the opposite message. Jesus did say it's the Father's good pleasure to give us the kingdom.