Well I got some good news for you. I don't think there is any damage at all to the map light and your map light housing is fine.
What you have in the map light is a T3 194 wedge base bulb in a removable plastic housing(bulb socket)
Here is a pic of the bulbs from my spare map light housing for my non sunroof 2009 Vibe and my 2012 Scion XB(no sun roof) that I found in a junk yard.
You can see both the bulb removed from the bulb socket and the other bulb in the socket
the bulb housing/socket/base have two metal tangs on them which makes contact with a metal strip on the top of the hole for the bulb on the map light housing, this allows power to get to the bulb. The bulb housing/base attaches to the map light housing by putting the bulb in the hole and turning clockwise a half turn.
What you did was in your effort to pull the bulb out of the plastic housing, you jostled the bulb's base counter clockwise and the bulb socket part/housing/base came loose from the map light and is in the roof above the map light.
The map light should have been removed from the roof and the bulbs removed with their bases. All you need to do is remove the map light housing(should be held up with 4 metal tangs just like the non sunroof map light BUT may have screws instead so be careful) and find the base of the bulb and put your LED light bulb into that base and then put it back into the map light housing and you should be good to go. In the event you cannot find it then simply go to Toyota and get a new bulb(they don't sell the base on its own) It should only be a few dollars
Here is what the non sunroof housing looks like from the top
Good luck and don't feel bad, the only way to learn is to try stuff