This page will display information about bugs or issues that I have come across while coding for Wordpress. Any Issues I discover will be listed here along with solutions if found.
There seems to be an error inside the remove_user method contained in the WP_User class.

The code is checking for the existence of the specified role using "empty($this->roles[$role])"

The problem is that $this->roles returns an index array with the roles as values. The code above would require a multidimensional array with the role names as the keys, not the values.

To solve this, I created a custom class that extends the WP_User Class and overrides the remove_role method.

My new method does an in_array check for the existence of the role. All of the existing WP_User functionality remains intact, therefore you can use this new class in it's place.

Download the plugin here: Downlaod WP_User_fix.