WASHINGTON — On a sultry day in late August, a dozen staff members of the Centers for Medicare and Medicaid Services gathered at the agency’s Baltimore headquarters with managers from the major contractors building HealthCare.gov to review numerous problems with President’s Obama’s online health insurance initiative. The mood was grim.

The prime contractor, CGI Federal, had long before concluded that the administration was blindly enamored of an unrealistic goal: creating a cutting-edge website that would use the latest technologies to dazzle consumers with its many features. Knowing how long it would take to complete and test the software, the company’s officials and other vendors believed that it was impossible to open a fully functioning exchange on Oct. 1.

Government officials, on the other hand, insisted that Oct. 1 was not negotiable. And they were fed up with what they saw as CGI’s pattern of excuses for missed deadlines. Michelle Snyder, the agency’s chief operating officer, was telling colleagues outright, “If we could fire them, we would.”

Interviews with current and former Obama administration officials and specialists involved in the project, as well as a review of hundreds of pages of government and contractor documents, offer new details into how tensions between the government and its contractors, questionable decisions and weak leadership within the Medicare agency turned the rollout of the president’s signature program into a major humiliation.