The following is respectfully quoted from “Naked Awareness: Practical Instructions on the Union of Mahamudra and Dzogchen” by Karma Chagmé with commentary by Gyaltrul Rinpoche
You can’t give someone else either good karma or bad karma, any more than you can give them virtue or non virtue. These are things that we accumulate and commit for ourselves. Whether we die in the womb, have a short life or a long life, these are the result of our karma.
Even great gods, such as Indra and Brahmā, with their extraordinary powers, are powerless when the karma that propelled them into their present existence is exhausted. The reason for the precept not to take refuge in mundane gods such as these is that they, like ourselves, are still entrapped in this cycle of existence. Since they have not liberated themselves, it would be difficult for them to liberate anyone else, so they are not suitable objects of ultimate refuge. Moreover, if you take refuge in, or absolutely entrust yourself to, other beings who are subject to the five poisons, you really have a problem, because they can’t release you from something they are not free of themselves. So this precept is truly for your own sake.
Some mundane gods may actually be great bodhisattvas, or even emanations of the buddhas appearing in the form of Indra, Brahma, and so forth. Nevertheless, it is generally good counsel not to take ultimate refuge in any of them, for it is difficult to discern which ones are actually bodhisattvas or emanations of buddhas. In a way, we don’t really need to worry about this. We don’t have much, if any, direct contact with such gods anyway.