Did the seller fill out a property disclosure form? If they did and indicated there was nothing wrong with the house then they may bare some responsibility. The seller (in NY) however can refuse to fill out the form but then you would have been credited for $500 as required by law. Either way it should have been disclosed in the title report which should have been reviewed by your attorney. If it was in the title report then you should get a new real estate attorney and have him/her look into who is legally responsible. If it is not in the title report then the title company may also be liable. Either way you should get a new real estate attorney to review all your closing documents to find out who bears responsibility. Since I am not an attorney I must tell you that everything I have just told you is not a legal opinion. (Ain't NY grand?)
The CO has nothing to do with home inspection, it is part of the "paperwork" which is your attorney's responsibility to check is in place, or if not, that you are happy to buy "as is" without CO. I don't think your attorney can reasonably argue that you didn't care about CO's for the property unless listing details provided to you by RE Agent disclosed that part of the property did not have CO. If they did not disclose there were COs missing, that's another person you can go after. This is not legal advice and in the situation you describe, you may need it from a new attorney, not the one you used.
Is this a newly constructed home? If so, it would be the builder's responsibility to obtain a c/o before title transfers. I'm curious how this came up "after closing"-did you just get a letter from the town stating that is has to torn down and rebuilt? Were there previous violations? Did you use a buyer agent for the transaction? Is the square footage accurate on the tax assessors site? It may be worth your while to hire an attorney before tearing anything down. Good luck!