Your problem sounds familiar, not sure if I have run into it before or helped someone who has. Anyhow, part of your problem is caused by misunderstanding the ArcPy Result object. The result object from calling Polygon to Raster (Conversion), specifically the getOutput method of that result object, isn't a Layer object or even the name of a layer in the map document. In this case, the result object is returning the path to the newly created raster dataset. RemoveLayer is throwing an AssertionError because it needs a "reference to a Layer object representing the layer to be removed," which the string you are passing it from the result object isn't. It appears you are having difficulties enumerating layers in the map document. Can you provide a code snippet where you run the geoprocessing tool and attempt to list all the layers afterwards?
... View more