I’ll post this just in case it helps others.
I was having a repeatable problem with a Play:5 which has a turntable connected to its Line In input, with AutoPlay enabled.
When starting playback from another source (e.g., a streaming service), the stream would start momentarily, then the speaker would flip to its Line In input, even though the turntable was completely powered down.
The solution: the line in cable was too close to the power cable. As the P:5 amp powers up, there’s a burst of noise on the power cable, seemingly enough to create a signal voltage on the Line In cable. Making sure the cables are well separated solved the issue. Using a better shielded Line In cable would probably also be a solution.