Yeah, you have understood religion and it's teaching
perfect example of why the OP was started.
The guy gives a perfectly reasonable explanation.
All those things we find horrible today, like idd slavery, were things that we common day practice back in the more primitive and barbaric ages, when these things were written down.
These books reflect the morals and values standards from those days very good.
They do so, because those people produced these books and stories.
That god doesn't find any issues with slavery, because the people that produced those stories didn't see any issues with slavery.
These are not the ideals of a celestial benevolent dictator. These are the ideals of goat herders in the iron age, reflective of the society they lived in. They didn't require to "defend" or come up with apologetics or theological excuses as to why infantacide, burning "witches" and slavery were ok, because they didn't actually recognise it as evil. Which is why they had their benevolent god engage in it.
Today we know better. If we would produce a bible today, it would infinitly more sophisticated and moral then anything they produced. I could rewrite the 10 commandments right now and do a better job.
For example, remove the first 4 and replace them all with "you shall not treat other human beings as being your property", and allready you have improved upon it.