Error Coercion Failed Input Cannot be Null for This Coercion

When you are using SharePoint approval workflow and it  is defined with Retention Policy and if it throws the error message"error coercion failed input cannot be null for this coercion".
In order to  resolve this issue, we need to run the following PowerShell commands.

$webApplication = Get-SPWebApplication http://mysites.

$webApplication.Properties["PolicyUseAssocDataAsInitData"] = 'true'

Happy Share Pointing :-)