Looks like a bug to me -- but it isn't necessarily a bug in the code. There are times that the documentation (and HELP cmdlet output) for a cmdlet are wrong.
If I were you, I'd first get the contents of the $PSVersionTable and verify you're using version 5.1. Next, visit the Format-Volume online documentation (format-volume ) and all the way at the bottom of the page, you'll find the "Feedback" section. Click on the "This page" button and describe your problem and provide the output of $PSVersionTable as supporting evidence, along with a link to this post (https://learn.microsoft.com/en-us/answers/questions/622675/powershell-whatif-parameter-was-ignored.html).
The document folks will verify with the developers that the -WhatIf swich is supported. If it's not they'll at lease update the documentation. They'll also file a bug report, but that won't be fixed right away.