gLayer.remove(myGraphicMarker) requires the passed in Graphic to be the same instance as a Graphic already inside the GraphicsLayer otherwise it doesn't know which one to remove. It looks like you're creating a new instance which won't work. You could instead loop through the graphicsProvider to find the instance you want to remove and then pass that to gLayer.remove().