Changing PhotonServerSettings at run time


I would like to set the App ID Realtime and App ID Voice in the PhotonServerSettings at run time so I can connect with different games using the same application. To make it simpler, I have a 'Start Scene' which is offline and who's only purpose is to set the AppIDs then load the next scene (called the 'Home Scene'), which is networked.

The point I have got to: (1) I can successfully run the 'Home Scene' (completely independently of my 'Start Scene') by setting the AppIDs before run time. This connects to the network. So far so good.

I leave the PhotonServerSettings as they are and run the 'Start Scene'. This runs the following line, then launches the 'Home Scene':

PhotonNetwork.PhotonServerSettings.AppSettings.AppIdRealtime = PhotonID;

where the 'PhotonID' is the exactly the same string as the LHS. However, just this line causes me to get the recurring error, after I ConnectUsingSettings():

OperationResponse 230: ReturnCode: 32767 (Invalid application id). Parameters: {} Server: NameServer Address:

Now if I go back and try straight from my 'Home Scene', which prior to attempting to change the AppIDs via code was working fine (see the lines by the (1)) I get the same error.

I am not sure what allows me to reset whatever I have inadvertently changed but its a combination of deleting the PhotonServerSettings and rebuilding Unity's library.

Please help 🤔