Dig oneself into a hole or pit
This is a very old expression meaning to get oneself into trouble. Its source is the Bible Psalms 7:15, “He made a pit, and digged it, and is fallen into the ditch which he made.”