In the Old Testament the sons of God are heavenly beings who rule over nations (Deut 32:8). Yet they can sin (Gen 6:2-4; Ps 82:2,5) and will be judged for their sin (Ps 82:6) https://www.howthebiblefitstogether.org/files/Gen-6.2-4a-Sons-of-God.pdf