While this topic might at first seem to come from left field, it has arisen in my mind when reading a number of recent threads. This topic in full requires many hours of research to fully assimilate but I'm now only introducing the topic and encouraging further reading.
In short, by the end of the common era Judaism included various heavenly figures that took on roles that, for all practical purposes, were those of God. I've mentioned certain ones in threads debating the Trinity in which I described them as 'emanations' of the deity. Concepts like Wisdom and Logos, even Light had been thoroughly personified and carried the weight of divinity toward a certain goal or reflections of an aspect of God. Writings of Philo of Alexandria, the diverse Wisdom literature and Qumran documents illustrate this well. In addition, interpretations of the 'Servant' of deutero-Isaiah, developing angelology, Shekhinah personifications, the enigmatic Son of Man of Daniel and Enoch literature all coalesced into what Rabbis later called the "Two Powers" theology. A conflation with the Davidic Kingly material from the Psalms contributed royal elements. Many passages in the OT and related literature were seen as support for worshipping this other power alongside YHWH.
Christianity naturally utilized these preexisting developments in its character of Christ. Some would argue this was the source of the Christain religion, formalized via visionary experiences and not just a post hoc justification for adoration of Christ. Either way, all of these elements are consciously used to describe Christ. Much research has been done regarding this "Two Powers" theology within Judaism prior to Christianity's formation.
I'd strongly recommend:
And
Also an excellent article that describes these notions as not heretical but simply different from the later Rabbinic (Post Christian) thought. Beyond Judaisms: Metatron and the Divine Polymorphy of Ancient Judaism (ebscohost.com)
As to how this concept could have originated Sigmund Mowinckel, held that ‘Conceptions of a more or less divine Primordial Man were widespread in the ancient east. Apparently, there is a historical connection between the varying figures of this type, which seem to be derived, directly or indirectly, from Iranian or Indo-Iranian myths.’1 The Jewish conception of ‘the Son of Man’ was ‘a Jewish variant of this oriental, cosmological, eschatological myth of Anthropos’,2 influenced by a syncretistic fusion of Iranian and Mesopotamian concepts. At the least, the phrase ‘Son of Man’ was thought to be a well-known, readily recognizable title for a messiah of a heavenly type, in contrast to the national, earthly, Davidic messiah. As recently as 1974 Norman Perrin could claim that all the recent studies of the ‘Son of Man Problem’ he had reviewed agreed on one point: ‘there existed in ancient Judaism a defined concept of the apocalyptic Son of Man, the concept of a heavenly redeemer figure whose coming to earth as judge would be a feature of the drama of the End time.’
The Son of Man in First-Century Judaism* | New Testament Studies | Cambridge Core
Moving on then.... It might be surprising but diverse preChristian conceptualizations of this divine figure influenced writers of the NT in subtle ways. For example, recent threads have debated when the Christ was to become King. Nicklesburg's excellent article Son of Man בר אנשׁ — Brill (brillonline.com) expounded upon this aspect. He suspects the ways Gospel writers understood the term Son of Man influenced how they envisioned his power. Matt has the Son of Man wielding kingly power at the eschaton while Luke and John see his exaltation as accomplished facts.
Anyway, maybe some of this material will stimulate research and a better understanding of 2nd Temple Judaism and the origins of Christianity.