Regarding the edge case described in OP (all 15 slots filled and buff to be overwritten is _not_in slot #1), client-side, the debuff overwrites the correct buff _visually_, but server-side the debuff overwrites whatever happens to be in slot #1 instead.
1. 15 slots filled. Berserker Spirit is in slot #3.
[You must be logged in to view images. Log in or Register.]
2. After casting Weakness. Client-side, Weakness visually overwrites Berserker Spirit in slot #3.
[You must be logged in to view images. Log in or Register.]
3. After zoning/syncing, we see that Weakness actually overwrote the buff in slot #1 instead, and Berserker Spirit remains in slot #3.
[You must be logged in to view images. Log in or Register.]