This question actually came up a while back, and prompted some discussion: https://www.reddit.com/r/AskHistorians/comments/6jy75b/why_was_the_sling_used_so_much_in_ancient_warfare/?utm_source=share&utm_medium=ios_app&utm_name=iossmf
Short version: slings were still used throughout the medieval period.
While bows and crossbows did become more popular thanks to higher draw weights, armor penetrating capabilities, and several other factors, slingers were still very useful and frequently used on the medieval battlefield. Not everyone in the army will be wearing heavy armor, and slings were still fine missile weapons for disrupting formations and rattling troops. There were also heavier variants like the slingstaff created, and arguably the trebuchet is just a slingstaff upscaled to a siege engine.