Whether your contention with God is sinful or not depends upon your intention and the manner of your contention. I think you were right in confessing it, as it could very well have been a sin, depending upon the circumstances.
If your contention with God was respectful, and if your intention was not so much to dispute the truth, but to seek the truth, then your contention may have not been sinful.
An example of a pious contention with God is found in the Book of Job. Job had said (13:3): “I will speak to the Almighty, and I desire to reason with God.” St. Thomas describes this verse in the following manner: “[Job] intended not to impugn the truth, but to defend it, and in seeking the truth thus, he had no wish to be inordinate in mind or in speech.”
I understand that a “it depends” kind of answer is often unsatisfactory. However, you never are wrong to confess what you think may be a sin. But know that sometimes, a pious contention with God is not necessarily sinful, if done prayerfully and respectfully, so long as you don’t intend to dispute the truth, but instead seek to the know the truth more fully.