I hosted a 15 person dinner at Seven Reasons and Ceibo, which were both great. They might each be able to host up to 40 as well, but you’d have to contact them.
Also have hosted similar dinners at Cranes, Nobu (I can’t recall if these had private rooms or not, I think so). The Jefferson has a private room and the food is good but there wouldn’t be much room to stand and mingle.
If price isn’t a concern you might be able to buy out Rooster & Owl, which is fantastic. I don’t think they would fit 40 though.