The error is thrown while supporting the 47th instance. It runs fine if I remove the action SetMyInstance_Instance47. I need to support 100 instances. The code snippet is as below.
<InstallExecuteSequence>
<Custom Action="SetMyInstance_Instance46" After="SetMyInstance_Instance45"><![CDATA[ACTION = "INSTALL" AND MYINSTANCE = "DontUseThis" AND (INSTANCE46INSTALLEDPRODUCTCODE = "" AND INSTANCE46INSTALLEDPRODUCTCODE64 = "" AND INSTANCE46INSTALLEDPRODUCTCODE32 = "") AND SECONDEXECUTE <> 1 ]]></Custom>
<Custom Action="SetMyInstance_Instance47" After="SetMyInstance_Instance46"><![CDATA[ACTION = "INSTALL" AND MYINSTANCE = "DontUseThis" AND (INSTANCE47INSTALLEDPRODUCTCODE = "" AND INSTANCE47INSTALLEDPRODUCTCODE64 = "" AND INSTANCE47INSTALLEDPRODUCTCODE32 = "") AND SECONDEXECUTE <> 1 ]]></Custom>
</InstallExecuteSequence>
Wix Error: The InstallExecuteSequence table contains an action 'SetMsiNewInstance' which cannot have a unique sequence number because it is scheduled before or after action 'AppSearch'. There is not enough room before or after this action to assign a unique sequence number. Please schedule one of the actions differently so that it will be in a position with more sequence numbers available. Please note that sequence numbers must be an integer in the range 1 - 32767 (inclusive).