Normally that would work... but given that the application is advising that transaction data may be incorrect,
listaddressgroupings output may also be inaccurate (as it is effectively showing what the wallet "believes" based on transaction data it holds).
To be 100% sure of the wallet balance... it seems the OP will need to scan every address/private key
Another option... might be to try the "bitcoin-wallet" binary and the
salvage option (as always, work with
a copy of the wallet.dat) and see if that helps remove the error.
Note that it may be necessary to use
rescanblockchain command with Bitcoin Core, after trying the salvage option, to ensure that Bitcoin Core has properly rescanned the blockchain data for appropriate transactions.
Another thought is that it's possible that the wallet.dat is actually for an altcoin... and not Bitcoin. OP should check some of the listed transactions shown in the wallet to confirm that they are viewable on a Block Explorer.
Right click a transaction on the "transactions" tab, and copy the Transaction ID... then paste it into the search on a blockchair.com. If it's not shown on the Bitcoin blockchain it might show up on an altcoin chain like Litecoin or Dogecoin.