it's a long-standing bug that sometimes (I think related to doing several trades in a row), you get a "transaction failed" error, and then your local display is off until you relog. It should not, however, result in permanently lost materials. (Edit: see e.g.
https://issues.frontierstore.net/issue-detail/54700 )
If you think you're actually losing materials, please take screenshots of your material inventory when arriving at the material vendor, after getting the error, and after relogging after getting the error.
You can also try exiting the trader interface (or relogging) after every individual trade, maybe it helps avoid the bug.