Is it Ambassador’s theatre?
I think it’s technically possible.
Get seats on the end of the row. Out of the theatre as soon as it ends, don’t stay for the clapping. If you’re not on the end of a row you’ll be caught up in the crowd leaving and that’ll take an age to get out!
5 minutes walk to Leicester Square station. Northern line, change at Embankment, district line to Blackfriars. That journey should take 15-20 minutes.
Train from Blackfriars at 16.29, arrives Gatwick 17.04. Pre-buy the ticket so it’s already on your phone to scan at the ticket barrier at Blackfriars.
Shuttle from South terminal to North - allow 15 minutes. It only takes a couple of minutes on the shuttle, but the time allows for getting off train, waiting, getting on and off shuttle.
Check in online in advance. Pre-book fast-track security queue.
So technically you could be through security by 17.45 which is just enough. But that relies on everything running on time.
To me, it’s not worth the risk. If the train is delayed and you miss the flight, the travel insurance may well question why you didn’t take an earlier train!