I realize that I am alone in this but I'm convinced that John and Paul used KOSMOS not to refer to "the whole world" or even "the Roman empire" but to temple-centric Judaism.
If we understand KOSMOS as "Judaism" it becomes clear what Paul is on about in Colossians:
Colossians 2:20-23 English Standard Version (ESV)
20 If with Christ you died to the elemental spirits [principles] of the world [Judaism], why, as if you were still alive in the world [Judaism], do you submit to regulations— 21 “Do not handle, Do not taste, Do not touch” 22 (referring to things that all perish as they are used)—according to human precepts and teachings? 23 These have indeed an appearance of wisdom in promoting self-made religion [ceremonies] and asceticism and severity to the body, but they are of no value in stopping the indulgence of the flesh.
This runs completely parallel to this:
[Mar 7:15-16 KJV] 15 There is nothing from without a man, that entering into him can defile him: but the things which come out of him, those are they that defile the man. 16 If any man have ears to hear, let him hear.
Paul's words to the Galatians become meaningful and lucid when we understand KOSMOS as "Judaism":
[Gal 4:1-31 KJV] 1 Now I say, [That] the heir, as long as he is a child, differeth nothing from a servant, though he be lord of all; 2 But is under tutors and governors until the time appointed of the father. 3 Even so we, when we were children, were in bondage under the elements of the world [Judaism]: 4 But when the fulness of the time was come, God sent forth his Son, made of a woman, made under the law, 5 To redeem them that were under the law, that we might receive the adoption of sons. 6 And because ye are sons, God hath sent forth the Spirit of his Son into your hearts, crying, Abba, Father. 7 Wherefore thou art no more a servant, but a son; and if a son, then an heir of God through Christ. 8 Howbeit then, when ye knew not God, ye did service unto them which by nature are no gods. 9 But now, after that ye have known God, or rather are known of God, how turn ye again to the weak and beggarly elements, whereunto ye desire again to be in bondage? 10 Ye observe days, and months, and times, and years. 11 I am afraid of you, lest I have bestowed upon you labour in vain.
Was Paul's concern related to "regulations" and "ascetics" and "days and months..." from the secular world? No, he was dealing with Jews who insisted on gentile observance of the Torah AND Oral Tradition!
Notice how these run parallel:
[Gal 3:2-3 KJV] 2 This only would I learn of you, Received ye the Spirit by the works of the law, or by the hearing of faith? 3 Are ye so foolish? having begun in the Spirit, are ye now made perfect by the flesh?
[Gal 4:9-11] 9 But now, after that ye have known God, or rather are known of God, how turn ye again to the weak and beggarly elements, whereunto ye desire again to be in bondage? 10 Ye observe days, and months, and times, and years. 11 I am afraid of you, lest I have bestowed upon you labour in vain.
So in my view it was God's great love for Israel that he gave his son. It was a covenant love. His son was the "death introduced by the testator (God)" to ratify the new covenant with the Jews.
John said "He came to his own". It does not say, "He came to everyone in the world". There are anecdotal contacts with gentiles but he clearly avowed "I was not sent but to the lost sheep of the house of Israel."
It was because of this new covenant that John the baptizer was sent and the spirit was poured upon all flesh. It was to raise Israel (IE: the remnant) from the dead and prepare the elect for the arrival of the kingdom.
It was because the leaders of the Jews were blinded by God as Isaiah had prophesied so that they would reject their king/messiah allowing the gentiles to "come in".
That God had a plan to bring in the gentiles was not known to John.
Jesus' disciples were part of Judaism but Jesus brought them out:
[Jhn 10:8-9 KJV] 8 All that ever came before me are thieves and robbers: but the sheep did not hear them. 9 I am the door: by me if any man enter in, he shall be saved, and shall go in and out, and find pasture.
Confirming my understanding of KOSMOS in John is this context:
[Jer 11:14 ESV] (14) "Therefore do not pray for this people [IE: The Jews], or lift up a cry or prayer on their behalf, for I will not listen when they call to me in the time of their trouble.
[Jer 30:7 CSB] (7) How awful that day will be! There will be no other like it! It will be a time of trouble for Jacob, but he will be saved out of it.
[Jer 7:16 ESV] (16) "As for you, do not pray for this people, or lift up a cry or prayer for them, and do not intercede with me, for I will not hear you.
[Jer 14:11 ESV] (11) The LORD said to me: "Do not pray for the welfare of this people.
[Zec 14:11 ESV] (11) And it shall be inhabited, for there shall never again be a decree of utter destruction. Jerusalem shall dwell in security.
[Mat 24:21 ESV] (21) For then there will be great tribulation, such as has not been from the beginning of the world [IE: Israel] until now, no, and never will be.
[1Jo 5:16 ESV] (16) If anyone sees his brother committing a sin not leading to death, he shall ask, and God will give him life--to those who commit sins that do not lead to death. There is sin that leads to death; I do not say that one should pray for that.
I am increasingly certain every time I look under that rock that in both John 3:16 and John 17:9 the referent of KOSMOS is temple-centric Judaism.
[Isa 54:8 ESV] (8) In overflowing anger for a moment I hid my face from you, but with everlasting love I will have compassion on you," says the LORD, your Redeemer.
[Jer 31:3 ESV] (3) the LORD appeared to him from far away. I have loved you with an everlasting love; therefore I have continued my faithfulness to you.
[Psa 103:17 ESV] (17) But the steadfast love of the LORD is from everlasting to everlasting on those who fear him, and his righteousness to children's children,
[Isa 55:3 ESV] (3) Incline your ear, and come to me; hear, that your soul may live; and I will make with you an everlasting covenant, my steadfast, sure love for David.
[Isa 61:8 ESV] (8) For I the LORD love justice; I hate robbery and wrong; I will faithfully give them their recompense, and I will make an everlasting covenant with them.