First of all, let's remember that the early church considered the "Infancy Gospel of James" (a.k.a. Protoevangelium of James) an apocryphal gospel and was excluded from the canon". See 2018 journal article The Protoevangelium of James and Its Reception in the Caucasus: Status Quaestionis. We can read the work here, translated by Roberts-Donaldson.
The story background for the headband passage
The story began with Joachim, a righteous man who was rebuffed for being the first to offer sacrifice for the day of the Lord
because he was childless. After confirming in the register that he was the only righteous man not having a child,
he grieved why God didn't grant him a child so he withdrew to the desert to fast 40 days without telling his wife Anna.
Anna, thinking that her absent husband had died, then began mourning. She was rebuked by her servant girl Judith who said it was not fitting for her to be mournful at the day of the Lord. Judith then offered her headband, which had some royal marking, for Anna to wear to the day of the Lord. Anna refused, fearing that there was some evil attached to the headband.
Judith responded why would she would curse Anna (by giving / loaning the headband) since it was obvious that the
Lord Himself had ALREADY "cursed" her to be childless. Being reminded of her childlessness she was grieved even further.
But even though Anna rejected the headband she accepted Judith's suggestion to quit mourning
and turned her attention to beseech God to bless her womb to conceive a child.
Thus the first two paragraphs demonstrated how Joachim and Anna were both righteous, pious, grieving, and
produced the appropriate response by crying out to the Lord.
Assistance for interpretation of the headband
I found 2 theses which can assist us interpret the confusing passages.
First, a 2010 Ph D. dissertation Accessing the Virgin: Gender and Purity in the Protevangelium of James by Lily Vuong at McMaster University (Ontario, Canada). Quotes (emphasis mine):
At the same time, Joachim's sojourn in the wilderness is depicted as a symbolic
death, given that Anna's response to her husband's mysterious absence is to act as if he
has died and put on mourning clothes (Prot. Jas. 2:1; 2:7). In fact, Anna's reaction and
her laments over her widowhood and childlessness (Prot. Jas. 2:1 ) form our
introduction to her, confirming at the outset, as with Joachim, her righteousness.
Given the dramatic irony established by the text's omniscient, third-person
narrative voice, readers simultaneously anticipate the revelation of the truth and observe
crucial evidence of Anna's righteousness as she reacts to the false information. Namely,
the narrator is able to depict Anna as a pious wife who, upon thinking that her husband
has died, acts accordingly. Likewise, the author implies that she too, like Joachim, has
misread her childlessness as an occasion for mourning rather than the portent of a
Symbolically, the author demonstrates Anna's righteousness by creating meaning
through the gap between what the reader knows and what the characters know. Upon
seeing her mistress weep and lament over the loss of her husband and over the state of her
childlessness, Anna's maidservant Euthine reminds her that the great day of the Lord is
not a time to mourn and offers her a headband ([Greek word omitted]), which Euthine herself
cannot wear because, as she reports, she is a "slave and it has a mark of royalty" (Prot.
Jas. 2:4). The precise meaning of the term [Greek word omitted] is obscure. From the narrative,
however, it is clear that the object may carry some form of sin or involves some form of
trickery or curse. The headband's symbolic nature, however, clearly propels the narrative
when Anna immediately rejects it (lit. Away from me!) ([Greek text omitted]; Prot. Jas.
2: 5) and accuses Euthine of attempting "to make [her] share in [her] sin"
([Greek text omitted]; Prot. Jas. 2:5). Anna's strong reaction to
the headband connects her with Joachim's brand of righteousness in that she, too, will not
accept any help to alleviate her barren state in any manner that might not be in accordance
with God's will.
Regardless of the precise nature of the headband, what is made abundantly clear is
that Anna will not accept anything about which she is not certain. This characteristic
speaks to her faith in God: Anna desperately wants to conceive a child, but she will not seek to do so at the risk of any possible sins against God or any possible association with any demon.
Euthine' s subsequent reproach of Anna parallels and recalls Reubel' s earlier
reproach of Joachim. Euthine links Anna's barrenness to divine disfavour: "The Lord
God has shut up your womb to give you no fruit in Israel" ([Greek text omitted]; Prot. Jas. 2:6). Ironically,
while Euthine errs in claiming that Anna will produce "no fruit in Israel," she is correct in
her assertion that childbirth lies in the hands of God, who alone has the power to give
birth to the barren or to close the wombs of the fertile-as the rest of the narrative will
show. Like Reubel, however, Euthine misreads Anna's childlessness as a sign of sin. In
her capacity as foil, then, Euthine increases the reader's sympathy for Anna by offering
continued misinterpretations of her situation. By introducing both Anna and Joachim
through their interactions with unskilled foil characters, the author carefully guides his
readers to the proper method of assessing righteous behaviour: Joachim is generous,
offers more than the necessary sacrifices, and prays and fasts, while Anna prays, resists
any form of "magic," and adopts the proper mourning practices when she thinks her
husband is dead (Prot. Jas. 2:1 ).
After the discussion with Euthine, Anna removes her mourning clothes and dons
her wedding dress, presumably in preparation for "the great day of the Lord"
([Greek text omitted]; Prot. Jas. 2:2). This change of clothing serves as a symbolic
marker of Anna's shift from barrenness to fertility, accompanied by the realization that
God controls all. That this turn of events in the narrative is initiated by the fast
approaching and very significant "great day of the Lord" requires further consideration.
Namely, what is precisely the "great day of the Lord," to which the narrator refers?
In his study on the impact of Yom Kippur on early Christianity, Daniel Stökl Ben
Ezra notes that there are three principal name forms used to refer to Yom Kippur based on
the description of its purpose (i.e., atonement), its common practice (i.e., fasting), and its
solemnity. The third purpose may hint towards the Protevangelium of James' allusion to
this significant holiday. Stökl Ben Ezra notes that one of the biblical uses for the term
Yom Kippur in Lev 16:31 is [Hebrew text omitted], which the Septuagint translates as "the Sabbath of
Sabbaths." To underscore the importance of the holiday, Philo also refers to Yom Kippur
as [Greek text omitted] (highest holiday). Likewise, the Protevangelium of James'
triple reference to "the great day of the Lord" (Prot. Jas. 1:4, 2:2, 2:3) may refer to Yom
Kippur given the text's clear emphasis on the solemnity of the festival. In my view, the
identification of the "great day of the Lord" with Yom Kippur also makes sense in light of
the multiple references to Joachim's sacrifices for atonement in Prot. Jas. 1:2, 5:1.
Second, a 2009 Master of Theology thesis Creating Narratives and Creating Feasts: The Entry of the Theotokos from the Protoevangelion of James to a Great Feast by Sarah A. Wagner-Wassen said the following about the headband (Note: in some translation the maid servant's name is Euthine instead of Judith, as in the translation used in this thesis) (emphasis mine):
The narrative dependency of the early chapters of the Prot. Jas. upon the Scriptural story of the birth and dedication of Samuel (1 Sam 1-2) is clear. However, the points of similarity also seem to be a bit distorted if one superficially compares them to the basic Masoretic text. A comparison with the Greek translations, and other Second Temple and later literature, shows that there is quite a bit of literary similarity between the two narratives. Both Hannah and Anna are described as having their wombs shut by God himself and therefore are very despondent. In 1 Sam 1:6 Hannah is sad because Peninnah would tease her on account of her barrenness and in Pseudo-Philo’s Liber Antiquitatum Biblicarum (L.A.B.) Peninnah tells Hannah, “A wife is not beloved even if her husband loves her or her beauty. Let Hannah not glory in her appearance; but she who glories, let her glory when she sees her offspring before her. When for a woman there will not thus be present the fruit of her womb, love will be in vain.”
It is tempting to see the role of Peninnah being refashioned in the Prot. Jas. in the character of Euthine, Anna’s servant girl who tells her that God has shut her womb and given her no fruit in Israel, causing Anna grief. However, this makes the episode in Prot. Jas. 2.2 where Euthine tries to give Anna a royal headband quite puzzling. In light of the interpretation in L.A.B., it may be easier to read Euthine as being in the role of prophetess. When Euthine tries to give Anna the headband Anna refuses it because she can not have a glorious appearance while she is childless. Nonetheless, the headband belongs to Anna, both because Anna is about to conceive Mary and because it has a royal mark, referring to the fact referenced later that Mary is a part of the royal tribe of David. The fact that the headband signified an impending conception may explain the severity of Anna’s response to Euthine’s offer; Anna believes that her barrenness is from God, and hence sees any possibility of conception to be a circumvention of God’s will and therefore the result of pagan magic. Euthine affirms Anna’s belief that God has shut her womb, but still chides Anna for not listening to her. After this Anna apparently has a change of heart because she puts on her “bridal garments” and goes to the garden to pray to God to bless her womb as he blessed the womb of Sarah, yet she is still reminded of her infertility. In the retelling of the narrative of 1 Samuel by Josephus, Hannah does not weep when Peninnah taunts her. Instead, she weeps when she sees “the other wife’s children sitting round about their mother.” Anna likewise mourns her own infertility when she sees a nest of sparrows in a laurel tree. This sylvan setting has led some scholars to read into the Prot. Jas. a connection with the sacred gardens at Antioch. However, by comparing this text to Josephus’ interpretation it may be more likely that the author created this scene in order to recreate the fertility image of children gathered around their mother.
Attempting to answer the questions
Let's use the two interpretations to try answering the questions:
What is the "head-band" they are talking about? What is its significance?
We don't know for sure what the significance is, other than showing Anna's great concern for purity and righteousness.
The 2nd thesis speculated that the headband may have some magical properties to influence her fertility. As a righteous woman she assumed that her barrenness was due to God's not opening her womb (like Hannah or Sarah).
Circumventing God's timing with magic would made it worse. She would instead beseech God to grant her a child,
again in the manner of Hannah.
Who is the woman that gave it to Judith, and why does the creator matter?
What sin would Anna be participating in by accepting the head-band?
The story didn't tell us who the creator of the headband was, and there was no indication that Judith meant harm.
But because the headband would be worn to the Temple of God and ceremonial purity is of great importance,
without knowing the headband's provenance it would be very dangerous to use, inviting God's wrath that would
make her situation worse.
Why would she want it in the first place?
The story didn't say that Anna wanted the headband in the first place.
What are things that Anna is denying she has done ("Depart from me; for I have not done such things")?
"Not done such things" must refer to not having sinned that caused God to punish her with barrenness or with the (presumed) death of her husband. In this way she was similar to Job who was accused by his "friends" of having sinned greatly to deserve his great misfortune.