If you are using VS2019, it was a bug introduced in the VS2019 v.16.9
You would need to install latest version of the SQL Server Integration Services Projects extension v.3.12.1 for VS2019.
The fix is documented here:
There is a regression in VS 2019 16.9 that will cause script task/component not work properly when editing script. VSTA team has released a new version to work around this issue. Please install latest version 3.12.1 to fix the issue, or you can keep on version 3.12 and manually download and install the latest version of VSTA 2019 here.
Here is the link: SQL Server Integration Services Projects