I'll be a bit philosophical here, life's full of regrets, and this will become one of them. Trust me; this will be one of the biggest mistakes you'll be making in this game. If you feed a 5-star weapon to some other weapon, then extra EXP would refund as ores. Yes, the weapon will act as weapons EXP material. There are videos about people feeding their 5-star weapons to other weapons on youtube; I'll recommend you to check them out before experimenting with it yourself. You should head to youtube or other genshin circles if you're into experimenting.