The Fourth Closet by Scott Cawthon

After a series of eerie disappearances and mechanical horrors tied to a shuttered family entertainment franchise, a young woman and her childhood friends dig into buried secrets about the company's past, confronting haunted animatronics, a ruthless inventor's twisted experiments, and the truth about a long-missing friend. As alliances crumble and identities are revealed, the group races to stop a plan that blurs the boundary between human and machine, culminating in shocking revelations about who can be trusted and what — or who — truly controls the animatronics.