It's a possibly good command however the wrong approach to fixing the issue, because it doesn't fix it at all, as you won't know what item it was that errored him. You'd have to fix the issue by providing a patch or telling him to patch up. Or in worst case senario if you know the item however it has no use disable it in item_db or item_db2 either the sql or txt one, whichever you use.
As the GM you should be able to use #delitem on the character with precision and not be deleting the entire inventory, you should know which item is erroring him, unless of course he has 50 new world items which you can't identify and don't know which it could possibly be, however even that could be figured out by finding the item name when he errors (screenshot). Just my comment to your way of fixing it.