Before Peter Pan was written in 1904, there were about 20 instances of the name Wendy used in the United States. There is only one instance of the name being used in the U.K., where author J.M. Barrie was from, but it was as a boy's name.
There are many theories to explain the origin of J.M. Barrie using Wendy as a name in the original Peter Pan play. The most accepted theory is that J. M. Barrie was inspired by the way his childhood friend, Margaret Henley, pronounced “friend” as “fweindy”. Other evidence points to the Welsh name Gwendolyn, and its diminutive variant “Wanda”.
These names were not used as independent fist names before the Peter Pan stories. The kids who inspired Barrie to write Peter Pan ended up getting adopted by the author because their parents passed away.