This issue has been fixed in the latest update of InDesign 2022 - version 17.3
Please update to this latest version of InDesign using Creative Cloud Desktop Application to get the fix.
An error occurred while saving the commentMark Rudge commented
solution is the veriable data heading can not have any spaces in it.
When you make it one word it will fix the problem.
I have done this with 100% success