This is presumably happening because your server is using more than one process. Any dynamic class will only exist within the process that creates it; and even then it won't persist across process restarts.
I don't know what your use case is here but this is certainly not the way to do it.