Although it’s popular among the masses, Schubert’s
Ave Maria is operatic (some would say maudlin), and has secular origins. Wikipedia explains its provenance thoroughly:
The piece is often referred to as Schubert’s Ave Maria; but it was originally composed as a setting of a song from Walter Scott’s popular epic poem The Lady of the Lake,[1] in a German translation by Adam Storck (1780-1822), and thus forms part of Schubert’s Liederzyklus vom Fräulein vom See. In Scott’s poem the character Ellen Douglas, the “Lady” of “the Lake” (Loch Katrine in the Scottish Highlands) has gone with her father to hide in the “Goblin’s cave” nearby to avoid drawing the vengeance of the King on their host, Roderick Dhu, the chieftain of Clan Alpine, who has been sheltering them since the King had exiled them. She sings a prayer addressed to the Virgin Mary, calling upon her for help. Roderick Dhu, who is higher on the mountain raising the clan for war, does not hear her song.
The piece is said to have first been performed at the castle of Countess Sophie Weissenwolff in the little Austrian town of Steyregg and dedicated to her, which led to her becoming known as “the lady of the lake” herself.
The opening words and refrain of Ellen’s song, namely “Ave Maria” (Latin, “Hail Mary”), may have led to the idea of adapting Schubert’s melody as a setting for the full text of the traditional Roman Catholic prayer Ave Maria. The Latin version of the Ave Maria is now so frequently used with Schubert’s melody that it has led to the misconception that he originally wrote the melody as a setting for the Ave Maria.
So what “happened” to the piece is that it was never particularly appropriate for liturgy in the first place.