Amid a massive recall in 2021, the medical device maker Philips raced to overcome troubling questions about its replacement machines as customers waited for help.

But as Philips publicly pledged to send out replacements, supervisors inside the company’s headquarters near Pittsburgh were quietly racing to manage a new crisis that threatened the massive recall and posed risks to patients all over again.

Tests by independent laboratories retained by Philips had found that a different foam used by the company — material fitted inside the millions of replacement machines — was also emitting dangerous chemicals, including formaldehyde, a known carcinogen.

Though Philips has said the machines are safe, ProPublica and the Pittsburgh Post-Gazette obtained test results and other internal records that reveal for the first time how scientists working for the company grew increasingly alarmed and how infighting broke out as the new threat reached the highest levels of the Pittsburgh operation.

The findings also underscore an unchecked pattern of corporate secrecy that began long before Philips decided to use the new foam.