I took these steps to fix the problem:
Open the ios folder of your flutter project in Xcode
In Xcode click on "Runner" ( Ensure that the "Runner PROJECT" and not the "Runner TARGET." ).
Duplicate a "Release-Production" Configuration :
In the Xcode menu bar, click on Editor.
Hover over Add Configuration.
Select Duplicate "Release" Configuration.
Rename the Duplicated Configuration:
A new configuration named "Release-Production Copy" will be created. Rename this new configuration to simply "Release."
Now you can retry building the IPA, the command should work just fine now.