That's a popular narrative, but I have yet to see any evidence of it. People are pretty comfortable with knowing there are things we don't understand. I don't think this is something that has changed through the ages. And if that were the reason people "invented" their gods, they sure did a lousy job of it since they mostly invented gods they didn't understand.
In the research I’ve done on the world religions, the mystery of why a particular deity blessed them or cursed them was part of the adherence to the belief. They didn’t know why, which means, they could not be gods because they didn’t understand.