Scrap Materials Disappeared!

This happened last night. I had approximately 460 scrap materials, but I needed 500 for an upgrade. I then accumulated over 500 for said upgrade… went to upgrade item and all I had was 38 materials. Didn’t use them on anything else, they just disappeared. Please help.