Tab key sometimes switches between Object/Edit mode, but sometimes between Weight Paint/Edit
That's how it works. If you go into a paint mode via a mouse click and then hit tab it will switch between edit and paint mode. Now if you go and click on the object mode and then hit tab it will switch between object and edit mode.

That is to say the last mode you select via a mouse click becomes the sticky mode that the "tab" key will switch to.

The beauty of this is so that when you need to do different sets of operations you could.


Vertex paint > edit
Object mode > edit
Sculpt mode > edit
etc ... you get the point I hope.