Make use of a Try Catch block, this might tell you what and exactly where teh error is. You did state that your code errors at - 'command.Bindings =string.Empty;' but the catch might give you way more information -
if (command.Bindings != null)
{
try
{
command.Bindings = string.Empty;
command.SaveChanges();
System.Diagnostics.Debug.WriteLine("Bindings cleared successfully.");
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine($"Error: {ex.Message}");
}
}