Just for you, I decided to read all 228 pages of the Laws of the Game (provided by FIFA, authorized annually by IFAB).
Just to let you know, any of the verbal reactions that you seem to assume would happen in your hypothetical situation would have the potential to earn a sending off for every individual that participated. That's a really clear and easy way to massively lose a game.
A player, substitute or substituted player who has been sent off must leave the
vicinity of the field of play and the technical area.
Now as for "scoring a goal for the other team". That can't happen.
A goal is scored when the whole of the ball passes over the goal line, between
the goalposts and under the crossbar, provided that no offence has been
committed by the team scoring the goal.
And one of the offenses is
shows a lack of respect for the game
So, the goal wouldn't count. The player who tried would be sent off. Your team would continue play while down a player, since you specified that we were out of substitutions.