Joseph thought adultery was a sin against God in Genesis 39:
David thought he sinned against God in Psalm 51:9 He is not greater in this house than I am, nor has he kept back anything from me except you, because you are his wife. How then can I do this great wickedness and sin against God?”
The prodigal son in Luke 15:4 Against you, you only, have I sinned and done what is evil in your sight; so you are right in your verdict and justified when you judge.
1 Corinthians 8:21 The son declared, 'Father, I have sinned against heaven and against you. I am no longer worthy to be called your son.'
When we disobey God's commands, we sin against God and he judges us, Isaiah 33:12 When you sin against them in this way and wound their weak conscience, you sin against Christ.
22a For the Lord is our judge; the Lord is our lawgiver.