Ban by IP prevents any username from signing in. To be honest, blocking by IP nowadays is almost useless. I can switch IP addresses with my ISP with the click of a button, or use a VPN, or switch to a mobile device and wander around, etc.
The behavior of blocking only logged in accounts has been like this as long as I can remember. To be honest, if you want to block the entire IP… don’t try to use software. Either use the server (like htaccess or a server firewall like csf) or with a WAF (like cloudflare).