I usually take small steps.
1) I put a small button between esp pin and ground
2) I leave it on "standby" and wait if it stays in standby correctly, waiting for the commands
3) action the various relays and I notice if the relays work...but I observe if some message FCM arrives wrong while I was commanding the relays.
4) I start pressing the message button and see if everything is ok
5) I will repeat several times, giving time for the message to arrive
6) if everything is ok, I focus on the intercom button
I hope it can help you find the problem and to us to understand if the problem is on the ESP side or on the intercom side
sry google T.