The 28-year-old had flown to Germany to complete a medical after talks continued between the two clubs over a fee, expected to be worth around £65million.
Palhinha only joined Fulham last summer and quickly established himself as a standout player at Craven Cottage, but was keen to leave after Bayern showed interest.
The Portuguese was keen to player Champions League football and looked to have earned a big-money move, only for the transfer window to shut before a deal could be completed.
Deadline Day LIVE! Follow all the latest transfer news and rumours
A final fee could not be agreed before the early deadline. German transfer window shut at 5pm UK time, while most across Europe, including the Premier League, shut six hours later in 11pm.
Fulham pushed hard to keep the player amid concerns over being able to adequately replace their star man in the final six hours of the summer window.
Pierre-Emile Hojbjerg and Scott McTominay were both reluctant to join Fulham as Palhinha’s replacement.
It is a huge disappointment for Palhinha but solves a lot of problems for Fulham, who are able to keep their star man.
Liverpool’s move for Ryan Gravenberch is not expected to be affected by the collapse of Palhinha’s move, along with Fulham’s attempts to sign Alex Iwobi from Everton.