This is confirmed as NOT WORKING:
Money as low as it should be and when try to buy any expendable item (price from 1500 to 4000eur) happens same thing: failed to purchase item by DB error
So someone should to mark it as detected/fixed!
It's a bug that has been patched, please close this thread.
You couldn't buy a permanent gun because you never really sold anything if it came back to your inventory. So basically your euros were still insufficient, even though you saw more than enough amount for your desired gun.