John 17:5 is easy to interpret once you have all the information
“the Lamb slain from the foundation of the world” (Rev. 13:8) and the chief cornerstone “foreordained before the foundation of the world” (1 Pet. 1:20). In time, the preplanned building would be “fitly framed together” (Eph. 2:21) as part of the “kingdom prepared…from the foundation of the world” (Matt. 25:34).
The Master understood something which requires faith to interpret but your forced literalism is stopping you from seeing it.
Christ was indeed foreordained, but he did not come into being until he was born of the virgin Mary in the days of Herod the king. In the same way, the glory he shared with the Father was not a matter of personal pre-existence, but of God’s eternal purpose, the grand design revealed through the prophets, when “the Spirit of Christ…testified beforehand the sufferings of Christ and the glory that should follow” (1 Pet. 1:11; cf. John 12:41).
As I mentioned to PS, who is still struggling with the embarrassment of being unable to prove hypostasis, any further attempt is futile. It is far better to acknowledge this honestly and work faithfully with the Scriptures we do have, rather than inserting concepts that are unbiblical.