This aition is only indirectly attested, but from two sources: a scholium on Iliad 13.66 and another on Lycophron's Alexandra 1141-1174.
Σ AD Il. 13.66
τοῖιν δ᾽ ἔγνω πρόσθεν Ὀϊλῆος ταχὺς Αἴας·
Αἴας Λοκρὸς μὲν ἦν τὸ γένος, ἀπὸ πόλεως Νά[ρυ]κος, πατρὸς δὲ Ὀϊλέως. οὗτος μετὰ τὴν Ἰλίου πόρθησιν αἴτιος τοῖς Ἕλλησιν ἀπωλείας ἑγένετο· Κασσάνδραν γὰρ τὴν Πριάμου ἱκέτον οὖσαν Ἀθηνᾶς ἐν τῷ τῆς θεοῦ σηκῷ κατήισχυνεν, ὥστε τὴν θεὸν τοὺς ὀφθαλμοὺς τοῦ ξοάνου εἰς τὴν ὀροφὴν τρέψαι. τοῖς δὲ Ἕλλησιν ὑποστρέφουσιν καὶ κατὰ τὴν Εὔβοιαν γενομένοις χειμῶνας διήγειρεν μεγάλους, ὥστε πολλοὺς αὐτῶν διαφθαρῆναι. διανηξάμενος δὲ Αἴας εἰς τὰς Γυράδας καλουμένας πέτρας ἔλεγεν χωρὶς θεῶν γνώμης διασεσῶσθαι. Ποσειδῶν δὲ ἀγανακτήσας διέσχισεν τὴν πέτραν καὶ τὸν Αἴαντα τῷ κλύδωνι παρέδωκεν. ἐκριφέντα δὲ αὐτὸν κατὰ Δῆλον νεκρὸν Θέτις ἐλεήσασα θάπτει. Ἀθηνᾶ δὲ οὐδ᾽ οὕτως τῆς ὀργῆς ἐπαύσατο, ἀλλὰ καὶ τοὺς Λοκροὺς ἠνάγκασεν ἐπὶ χίλια ἔτη εἰς Ἴλιον ἐκ κλήρου παρθένους πέμπειν. ἡ ἱστορία παρὰ Καλλιμάχῳ ἐν Α Αἰτίων καὶ παρὰ τῷ ποιητῇ ἐν τῇ Δ τῶν Ὀδυσσειῶν (Od. 4.499-511) παχυμερῶς.
Lycophron, Alexandra 1141-1174
πένθος δὲ πολλαῖς παρθένων τητωμέναις
τεύξω γυναιξὶν αὖθις, αἳ στρατηλάτην
ἀθεσμόλεκτρον, Κύπριδος λῃστὴν θεᾶς,
δαρὸν στένουσαι, κλῆρον εἰς ἀνάρσιον
πέμψουσι παῖδας ἐστερημένας γάμων. 1145
Λάρυμνα, καὶ Σπερχειέ, καὶ Βοάγριε,
καὶ Κῦνε, καὶ Σκάρψεια, καὶ Φαλωριάς,
καὶ Ναρύκειον ἄστυ, καὶ Θρονίτιδες
Λοκρῶν ἀγυιαί, καὶ Πυρωναῖαι νάπαι,
καὶ πᾶς Ὁδοιδόκειος Ἰλέως δόμος,1150
ὑμεῖς ἐμῶν ἕκατι δυσσεβῶν γάμων
ποινὰς Γυγαίᾳ τίσετ᾽ Ἀγρίσκᾳ θεᾷ,
τὸν χιλίωρον τὰς ἀνυμφεύτους χρόνον
πάλου βραβείαις γηροβοσκοῦσαι κόρας.
αἷς ἀκτέριστος ἐν ξένῃ ξέναις τάφος 1155
ψάμμῳ κλύδωνος λυπρὸς ἐκκλυσθήσεται,
φυτοῖς ἀκάρποις γυῖα συμφλέξας ὅταν
Ἥφαιστος εἰς θάλασσαν ἐκβράσῃ σποδὸν
τῆς ἐκ λόφων Τράρωνος ἐφθιτωμένης.
ἄλλαι δὲ νύκτωρ ταῖς θανουμέναις ἴσαι 1160
Σιθῶνος εἰς θυγατρὸς ἵξονται γύας,
λαθραῖα κἀκκέλευθα παπταλώμεναι,
ἕως ἂν εἰσθρέξωσιν Ἀμφείρας δόμους
λιταῖς Σθένειαν ἵκτιδες γουνούμεναι.
θεᾶς δ᾽ ὀφελτρεύσουσι κοσμοῦσαι πέδον, 1165
δρόσῳ τε φοιβάσουσιν, ἀστεργῆ χόλον
ἀστῶν φυγοῦσαι. πᾶς γὰρ Ἰλιεὺς ἀνὴρ
κόρας δοκεύσει, πέτρον ἐν χεροῖν ἔχων,
ἢ φάσγανον κελαινόν, ἢ ταυροκτόνον
στερρὰν κύβηλιν, ἢ Φαλακραῖον κλάδον, 1170
μαιμῶν κορέσσαι χεῖρα διψῶσαν φόνου.
δῆμος δ᾽ ἀνατεὶ τὸν κτανόντ᾽ ἐπαινέσει,
τεθμῷ χαράξας, τοὐπιλώβητον γένος.
Σ ss3 Lyc. 1141
λοιμοῦ κατασχόντος τὴν Λοκρίδα διὰ τὴν εἰς Κασάνδραν ἀθεμιτομιξίαν Αἴαντος ἔχρησεν ὁ θεὸς <β᾽> παρθένους ἐναυσιαίας εἰς Τροίαν τῇ Ἀθηνᾶι ἀποστέλλειν εἰς χίλια ἔτη. πεμπόμεναι δὲ αὗται ἐφονεύοντον ὑπὸ τῶν Τρώων· προυπαντῶντες γὰρ οἱ Τρῶες ἐλιθοβόλουν αὐτὰς· εἰ δέ τινες ἐκφύγοιεν ἀνελθοῦσαι λάθραι εἰς τὸ τῆς Ἀθηνᾶς ἱερόν, τὸ λοιπὸν αὗται ἱέρειαι ἐγίνοντο. τὰς δὲ ἀναιρεθείσας ἔκαιον ἀκάρποις καὶ ἀγρίοις ξύλοις, τὰ δὲ ὀστᾶ αὐτῶν ἀπὸ Τράρωνος ὄρους τῆς Τροίας εἰς θάλασσαν ἔρριπτον· καὶ πάλιν οἱ Λοκροὶ ἀπέστελλον ἑτέρας. ταύτης δὲ τῆς ἱστορίας καὶ Καλλίμαχος μέμνηται.
Fr. 35 Harder (= 35 Pf.) Σ AD Il. 13.66 and Σ ss3 Lyc. 1141
According to the scholium on Iliad 13.66, this story is located in Aetia Book I. Ajax of Locris, the son of Oeleus, raped Cassandra in the temple of Athena at Troy. The goddess in anger turned her eyes to the roof and raised storms against the Greeks as they returned from Troy. Shipwrecked, Ajax swam to the Grynades, but Poseiden broke up the rocks causing Ajax to drown. When his body washed up on Delos, Thetis buried him there. Athena then apparently struck the Locrians with a plague, which they lifted by sending two Locrian virgins as tribute to the temple of Athena at Troy each year. When the girls landed they were forced to run a gauntlet of Trojans who tried to stone them. If they escaped, they served for life in Athena's temple. Those who died were burned and their bones scattered on the sea. The custom was discontinued in the fourth century BC, but was revived by either Antigonus Monophthalmos or Gonatas, though the terms of servitude were mitigated. The story may, then, have had a contemporary resonance for Callimachus. It is unclear how much of the story Callimachus included, but if G.-B. D'Alessio's conjecture that fr. 33 concerned the statue of Athena at Siris with her eyes closed, Callimachus may well have included the behavior of Athena's statue at Troy as a parallel aition.
We have two complete codices of ancient scholia to Lycophron's Alexandra: Marcianus 476, which Edward Scheer in his authoritative edition of Alexandra with the scholia calls s, and Naples II D 4, which Scheer calls s3. In addition there are two books consulted by the Byzantine scholar John Tzetzes and used in his extant commentary on the Alexandra, but now lost. These are termed s4 and s5 by Scheer. See E. Scheer, Lycophronis Alexandra, vol. 2 (Berlin: Wiedmann, 1908), p. xix. The scholia to Lycophron are probably ultimately based on the commentary of Theon, son of Artemidorus, a grammarian from the time of Augustus and Tiberius, and so may well preserve genuine information about the Aetia. See Callimachus, Lycophron, Aratus. Hymns and Epigrams. Lycophron: Alexandra. Aratus: Phaenomena. Translated by A. W. Mair, G. R. Mair. Loeb Classical Library 129. (Cambridge, MA: Harvard University Press, 1921), pp. 316–18.
Σ AD Il. 13.66
And of the two, swift Ajax son of Oeleus knew (him) first
Ajax was from the city of Naryx, a Locrian by birth, and his father was Oeleus. After the sack of Troy he was the cause of the destruction of the Greeks. For he raped Cassandra, the daughter of Priam, a suppliant of Athena in the godess' temple. Therefore, the goddess turned the statue's eyes toward the roof and raised fierce storms for the Greeks when they were returning and had reached the area of Euboea, so that many of them perished. Ajax swam to the rocks which are called Gryades and said that he had been saved in spite of the gods' plan. Poseidon got angry and split the rock and handed Ajax over to the waves. When his corpse was washed ashore on Delos, Thetis pitied him and buried him. But not even then did Athena give up her anger, but she also forced the Locrians to send girls chosen by lot, to Troy for a thousand years. The story is found in Callimachus in book 1 of the Aetia and briefly in the poet in book 4 of the Odyssey.
Lycophron, Alexandra 1141–1174 (trans. A.W. Mair):
And to many women robbed of their maiden daughters I shall bring sorrow hereafter. Long shall they bewail the leader1 who sinned against the laws of marriage, the pirate of the Cyprian goddess, when they shall send to the unkindly shrine their daughters reft of marriage. O Larymna and Spercheius and Boagrius and Cynus and Scarpheia and Phalorias and city of Naryx and Locrian streets of Thronium and Pyrnoean glades and all the house of Ileus son of Hodoedocus – ye for the sake of my impious wedlock shall pay penance to the goddess Gygaea Agrisa, for the space of a thousand years fostering to old age your unwed daughters by the arbitrament of the lot. And they, aliens in an alien land, shall have without funeral rites a tomb, a sorry tomb in wave-washed sands, when Hephaestus burns with unfruitful plants the limbs of her that perishes from Traron’s peaks, and tosses her ashes into the sea. And, to fill the place of those that shall die, others shall come by night to the fields of Sithon’s daughter by secret paths and glancing fearfully, until they rush into the shrine of Ampheira8 as suppliants beseeching with their prayers Stheneia. And they shall sweep and array the floor of the goddess and cleanse it with dew, having escaped the loveless anger of the citizens. For every man of Ilios shall keep watch for the maidens, with a stone in his hands, or a dark sword or hard bull-slaying axe, or shaft from Phalacra, eager to sate his hand athirst for blood. And the people shall not harm him who slays that race of reproach, but shall praise him and grave his name by ordinance.
Σ ss3 Lyc. 1141
When Locris was hit by a plague because of Ajax's unlawful intercourse with Cassandra, the god ordered that <two> girls should be sent to Troy every year for Athena for a thousand years. And when they were sent they were killed by the Trojans, for when advancing to meet them the Trojans threw stones at them. If some of them escaped, going up to the temple of Athena furtively, they became priestesses for the rest of their life. They burned the girls who were killed on wild wood without fruit, and threw their bones from Mt. Traron in the Troad int the sea. And then again the Locrians sent other girls. Also Callimachus mentions this story.