Seems like the best approach, do you have any reference for the API behavior? Also, I guess we should print a warning. The most defensive approach would be to drop either TRASH or SPAM labels, but I don't think it is the most frequently desired behavior.
I don't think there's any reference, only the error message (and well it makes sense). Could make the handling dependant on the excluded tags in the notmuch config. If spam and trash are excluded, do what I did; otherwise apply inbox again (that would match the visible local behaviour).