This is broke. Try it out yourself.
specifically, the remove_cap, add_cap to WP_User ability.
If you follow this it will still not work.
I’m giving up at this point, I wrote a little more of the summary of the problem and posted the problem plugin here if anyone can solve the problem.
I wanted to remove a capability from a user (leaving it in the role) as well and after a lot of experimenting and browsing through the WP core I have found this works:
$user->add_cap("publish_posts",false)
What happens is that $user->add_cap() puts an entry into the user capability overrides and $user->remove_cap(), deletes an entry from the overrides. To actually remove a capability the user inherits from their role(s) you have to use add_cap with a grant value of false. Basically the function names would be better called add_override and remove_override.
If you find that still isn’t producing the result you want, it may be that you need to be using get_user_to_edit($id) to generate your user object.
This works in 3.1.4, I haven’t tried out 3.2 yet.