Doctor Strange could be the key character. Since he had the ability to see different futures, he might have found a way to change the outcome more drastically. For instance, he could have used his magic to trap Thanos in a time - loop or some other magical prison, preventing him from getting any of the stones.
One possible scenario could be that Doctor Strange saw a different future where they managed to stop Thanos before he got all the Infinity Stones. So, the Avengers might have worked together more effectively from the start. For example, they could have sent a team to intercept Thanos on his way to collect the stones on different planets.
One possible alternate ending could be that Doctor Strange actually manages to defeat Thanos using his magic before he can snap his fingers. Strange could have found a way to trap Thanos in a time loop or a different dimension, thus preventing the mass destruction that occurred in the original ending.
A really interesting scenario could be where Thor aimed better when he had the chance to kill Thanos. He could have ended the whole threat right there. If he had struck Thanos in the head instead of the chest, the events of the snap would never have occurred, and the universe would have been saved from that mass destruction.
One alternate ending could have been that Doctor Strange saw a different future where all the heroes didn't have to sacrifice so much. Maybe he found a way to defeat Thanos without half of the universe being dusted. For example, he could have used the Time Stone in a more creative way to trap Thanos in a time loop or something similar.
If in the fanfiction's alternate ending, Thanos is defeated early, characters like Black Widow and Vision might not have to sacrifice themselves. Their relationships with other characters would continue to grow and develop in a positive way. For example, Vision could further explore his relationship with Wanda. Also, Tony Stark might not be as traumatized, and his relationship with Pepper could progress more smoothly without the weight of the snap on his shoulders.
They could have escaped Thanos' clutches earlier. If they had worked more closely together from the start, they might have noticed Thanos' trap sooner and found a way to avoid it. This would have changed the whole course of the Infinity War as Gamora wouldn't have been sacrificed and Peter would have had his full team intact.
In this type of fanfic, the Infinity Stones could have a very different effect in the Harry Potter universe. For example, the Time Stone could be used to reverse dark spells or resurrect fallen wizards. However, the Stones' power might also be limited by the magic rules of the wizarding world. The fanfic could delve into how the characters from both universes adapt to the presence of the Stones and how they use or misuse their power.
Yes, there are likely many fanfics about Peter in Infinity War. Fanfiction writers often focus on characters like Peter and create their own stories set within the events of Infinity War. These can range from exploring his relationships with other characters, like Tony Stark, to imagining different outcomes for his role in the battle.