The question of whether God can or instead cannot sin has repeatedly been asked.
Part of the problem in answering that question are limitations of the English language, which is one of the causes the original Texts of the Old and the New Testament were written in precise Hebrew and precise Greek, respectively.
For example, when one says: "he CAN do it," one speaks of ability, whereas in contrast when one states: "he MAY do it," one instead speaks of permission, and stating that: "he MIGHT do it" implies prediction. Similarly, to proclaim whether or not one is CONCERNED about something implies the negative, whereas declaring that one REGARDS something is instead positive, and the words: PERTAINS TO are a generic possibility of either one, though not indiscriminately both.
Regarding (not concerning) the nature of God Almighty and whether or not He can sin, we must keep in mind that sin is disobedience to the will of God. Thus, whatever the LORD chooses to do is the will of God, and so it is impossible for Him to disobey Himself, since He sets the standards and defines what is His own will. However, being an entity of moral free will and choice, He both can and does choose whether or not to be consistent with whatever He said previously. And in His case, He has always chosen to in fact be consistent with whatever He has decreed previously.
Therefore, although technically God can "sin" in the sense of contradicting Himself and being inconsistent with His own past-compared-to-present Divine declarations and actions, He simply is not contradictory nor inconsistent. Although He CAN sin, He DOES NOT sin, and because of that He (in one sense) "cannot" sin. Scripture puts it this way:
II Timothy 2:13 ....if we are faithless, He remains faithful, for he cannot deny Himself.
Titus 1:1 Paul, a servant of God and an apostle of Jesus Christ, to further the faith of God's elect and their knowledge of the truth which accords with godliness,
2 in hope of eternal life which God, who never lies, promised ages ago.
James 1:13 Let no one say when he is tempted, "I am tempted by God"; for God cannot be tempted with evil and He himself tempts no one;
14 but each person is tempted when he is lured and enticed by his own desire.
17 Every good endowment and every perfect gift is from above, coming down from the Father of lights with whom there is no variation or shadow due to change.
I John 3:9 No one born of God commits sin; for God's nature abides in him, and he cannot sin because he is born of God.
Both you the reader and I the author have heard the expression: "original sin."
It is inferred by such Bible passages as:
Psalm 51:5 Behold, I was brought forth in iniquity, and in sin did my mother conceive me.
Romans 7:18 For I know that nothing good dwells within me, that is, in my flesh. I can will what is right, but I cannot do it.
To equate human free will with original sin or sinful flesh is obviously errant, because to wrongly so equate them would be to categorize God's creation of humankind sinful and thus - logically - misconsider both the Creator Himself and His human creatures: sinful. That would clearly contradict:
Genesis 1:31 And God saw everything that he had made, and behold, it was very good. And there was evening and there was morning, a sixth day.
Romans 9:11 .....though they were not yet born and had done nothing either good or bad, in order that God's purpose of election might continue, not because of works but because of his call....
Merely because our ancestors frequently chose to do evil with their benign free wills, does not automatically make us their offspring guilty of presumed "original sin:"
Ezekiel 18:20 The soul that sins shall die. The son shall not suffer for the iniquity of the father, nor the father suffer for the iniquity of the son; the righteousness of the righteous shall be upon himself, and the wickedness of the wicked shall be upon himself.
It is not encountering temptation that causes "original sin," but wilfully giving in to such temptations:
Genesis 4:7 If you do well, will you not be accepted? And if you do not do well, sin is couching at the door; its desire is for you, but you must master it."
Luke 17:1 And he said to his disciples, "Temptations to sin are sure to come; but woe to him by whom they come!
I Corinthians 10:13 No temptation has overtaken you that is not common to man. God is faithful, and he will not let you be tempted beyond your strength, but with the temptation will also provide the way of escape, that you may be able to endure it.
Consider Satan being allowed by God to test Job of the Old Testament. The first round of misfortune caused Job to kind of throw it all off with an easy-come/easy-go attitude of "So what? God gives, and God takes away. Big deal." But the second and lastly-recorded round when being afflicted with loathsome sores caused Job to over-complain for chapters upon chapters. When confronted by the theological and spiritual logic of Elihu (a type of Christ), he proudly did not answer but never complained anymore. But it took God the Creator to declare enough facts of nature (God's intelligently-designed handiwork) to help Job finally repent and consequentially receive restored fortunes. Even Satan's ultimate (but God-allowed) attack of Job dying an old man full of days was not a victory for The Devil, because Job (inspired by the Holy Spirit while in his misery) reminded everyone: "I know that my Redeemer, who will slay me, lives. And after my body is destroyed, yet in my flesh shall I see God."
Another factor to consider is that infants, whose only means to convey dissatisfaction relating to need for diaper change, hunger for food, discomfort because of inhospitable temperatures or too-constrictive clothes, or whatever else obviously detrimental to human satisfation or even existence.....understandably and faultlessly wimper or cry because of their lack of functional adult vocabulary. It is not unreasonable to assume that even the virgin Mary (being human and somewhat of a saintly sinner herself) did NOT exercise perfect child care relating to human-needs-beset baby Jesus, resulting in His probable action of notifying her of her occasional deficiency by bawling until she figured out His need and did what was required for His wellbeing.
Being a actual virgin when conceiving and bearing Jesus, it is evident that one of Mary's sinful shortcomings was NOT fornication. Some in the catholic cult have used that lack of fornication to more or less deify her with bigoted, women-equal-with-men, feminist-sexist prejudicial chauvenism as: "the mother of God" (wrongly inferring that Mary conceived and birthed God the Father, the Son of God, and God the Holy Spirit)....and so is pseudo-Matriarch of "Mother Church". Why that is is because when one refers to "God," what is generally understood is that God is the Trinity....regardless of the fact that Jesus is God, and "the Almighty Father, King of kings, Lord of lords as it states in Isaiah 9:6, and "before Abraham was, I AM" referred to in John 8:58.
Mary had no part, of course, in imparting or begetting to Jesus his Divine nature as The Son of God. That Divine nature was only given by the Heavenly Father through The Holy Spirit. All Mary did was participate in the creation of the incarnated body of baby Jesus as the son of man. Ultimately, being a saved sinner, Mary was a sinner of sorts (as all Christians are) nevertheless, and eventually died physically because of the murderous sins of others against her and her own occasionally-faithlessness-based sins.
Superbaby Jesus grew up to become Superman Jesus, and every step along the way from His conception and birth through early children and later childhood to teenaged adulthood to death on a cross and thereafter never once used His human free will to choose to sin, but instead always and perfectly and successfully resisted all temptations to sin. By so doing, He was qualified to become and be THE ONLY PERFECT atonement for all humanity of all the past, present, and future to cancel the sins of all penitent who have believed, now believe, and will believe that His sacrifice of Himself on a cross has absolved, does absolve, and will absolve them and guarantee their entrance into and permanent stay within eternal heavenly bliss.