I've seen the anime spell Myne's name as Main in the credits and such, but the light novels use Myne. Why is this? Where does this name even come from?
As per Shaymin Gratitude, the katakana マイン when transliterated directly would be Main. This spelling can be seen in the cypher text used in the manga and anime and was used in the English subtitles on Crunchyroll.
The translator of the light novel and manga (Quof), however, has stated that the author herself chose the spelling “Myne” which is why it is used in the English books:
Myne's name is a bit of a special case wherein I didn't ask for permission for a certain spelling; instead, I asked flat-out "How should I spell her name in English?" and listed some possibilities such as Maine, Maïne and Myne (since back then the fact the fan TL went with Maïne was actually a point of contention, and I was unsure of what was intended to begin with). The author responded to use Myne. She actually mentions this on her blog with her reasoning: https://mypage.syosetu.com/mypageblog/view/userid/372556/blogkey/2269579/index.php?p=2
Quof has further expanded on the discrepancy (on the J-Novel club subscriber forums):
The documents with that name are purely the work of the anime / manga artists, with the letters themselves having been made up by the manga artist on her own. The name itself is just a 1:1 copy of the romaji (マイン -> main) with no more thought to it than that. It's not a reflection of Main being the proper or intended romanization of her name, it's just a reflection of the anime/manga staff working off the direct romanization since it's the easiest thing for them. Miya Kazuki herself asked for me to use Myne and makes sure it's spelled Myne in Japanese media where she can, after all. The spelling in the fantasy language is just something that slipped through the cracks.
The author's reasoning for Myne's name is explained in the Q and A of the official fanbook.
Q: What was your inspiration for Urano Motosu's name? Also, I see [...] come up in a list of German names, but not "Myne". What was that based on?
A: "Urano Motosu" is a Japanese pun that means "all books should belong to me." For the English localization, I chose the name "Myne" from a list of possible romanizations the translator sent me. It comes from the English "mine," meaning "belonging to me," and the German "main," as in "main character."
Myne's name is spelled like this in Japanese Katakana: マイン. The symbols correlate to the English ma, i, and n, but would be pronounced more like the word "mine" rather than "main", because English is weird. It seems the author actually had both of these words in mind when choosing the name though. Spelling it as Myne helps readers differentiate it from these English words.