Technically I guess we should call this a feature.
You're trying to logout but the CSRF token in that tab expired, which throws the standard error for expired token. The error is not triggered because of the logout state, but because the previous logout forced a CSRF token refresh.
For sure, a better UI asking you to try to logout again (this time with a fresh token) would be better.
Checking if you're connected or not upon an invalid token in order to silence the error could defeat the purpose of the CSRF token by exposing whether you're logged in or not. Not an expert on that though.