Back in the 1960s, yes, that was a reasonable approach, and we took it. In your coding analogy, we believed there was a specific bug and started applying patches to address it.
But we've been doing that for more than half a century now and it hasn't helped. So now maybe we should consider whether the actual bug might be something else, requiring different patches to fix.
That doesn't mean we haven't been trying to fix racism for more than half a century. It just means the "fix" hasn't been working.