Cannot bring SQL resource online after installation

I'm going through what feels like iteration 14,354 of the process to migrate my customer to a completely new platform, which involves moving from physical to virtual resources and leaping forward 3-4 product versions for just about every product on which the customer's solution runs, which includes a generous helping of SQL Server.

I'm building several clustered SQL instances and to save time (and sanity) am using a scripted approach to install SQL. Everything was going along swimmingly until I hit a wall on one failover cluster with two SQL instances. With both instances, the SQL installer would run almost to completion until it would get to the point where it tried to online the SQL cluster resource, and it would just hang for several minutes and then fail. The error in the log was:

“The cluster resource 'SQL Server (MyInstance1)' could not be brought online. Error: There was a failure to call cluster code from a provider. Exception message: Generic failure . Status code: 5023. Description: The group or resource is not in the correct state to perform the requested operation.”

As I'd installed literally a dozen other SQL instances using my scripts before, I was perplexed as to why this cluster was giving me issues. Bing'ing around didn't give me much in the way of results (and many of the hits on that error were red herrings), so I went exploring the Event Logs. One thing that caught my eye was that in the System Event Log I had an error for the following:

Cluster network name resource 'SQL Network Name (MySqlNetworkName)' failed registration of one or more associated DNS name(s) for the following reason:
DNS operation refused.

Now remember I said it felt like iteration 14,354 of this process? That's because I've installed many of these SQL instances, using the same names, in slightly different configurations, as part of earlier efforts. When I checked DNS, lo and behold there were stale DNS records of my SQL network name resources. Once I deleted these, I was off and running.

HTH someone in the future - this was NOT a fun one to figure out.