After finally getting an article listed on google scholar via preprints, Google Scholar has not listed me as an author on my paper on either preprint it has indexed. I was the one who uploaded them to the preprint sites and I am the second author but they have only listed the first and third author and have not listed me. How do I change or have this edited. And how does something like this even happen in the first place
It is a bit difficult to speak on behalf of Google here. The best idea is probably to contact them directly .
Before you do that, however, I would encourage you to double check if the details on the websites where your paper is published are correct. Much of what Google Scholar does is just indexing those websites and taking their data from there. Google explicitly recommends to ask for corrections there and not on Google Scholar. They also say state that an update to any details might take quite a bit of time, in the order of months . So any recent correction to details on the publisher's side might not be updated yet.
Contact the first or third author. I think (but am not certain) that if Scholar has put them on it, they will then be able to edit the listing.
As to how it happens... ask Google? They won't tell you, though.