This verse, if inflected correctly, makes perfect sense. However, if ‘reasoned’ out, it easy to come to very incorrect conclusions….
GEN 6:6 And the Lord was sorry that He had made man on the earth, and He was grieved in His heart.
God created man. Now here’s the pivotal ‘key’. He loved man. He was going to send his son to die on man’s behalf, so as to save them. But here, in Genesis 6, man had made himself un-saveable. Man had become reprobate. The Apostle Paul describes this ‘state’ (reprobate) in Romans 1 - essentially in this state, man is beyond being saved. And, when or if any ‘man’ is un-saveable, it grieves his heart.
So, let’s inflect that verse correctly. “The Lord was sorry he had made man” … means, or rather should be read or understood as … God feeling sorry for the man he had created. Because man had ‘destroyed himself’, and was heading to an eternity of being separated from God. Grieving for man.
He (God) never intended this. It was not his will. I appreciate that those with a Calvinistic perspective won’t accept this, and they will have an alternative explanation - but this is the way I see it.