The engine does not support dynamically creating layers. All the code assumes a fixed set of layers created on startup and does not take in to account changes, because it doesn't have to. All the internal layer code should also be considered private methods for the engine's use only and should not be used from the SDK. You will probably break all sorts of things if you do this, and we will not offer any support for using private and undocumented parts of the engine, so you should find a different solution.