Not knowledgeable enough to say for certain, but i doubt very much that there is an issue with the captureId when using CoreELEC.
The issue is likely one or more of the following:
Trying to capture too much or too little data; and/or
Not waiting long enough for the frame to be captured.
Should try to capture at a higher resolution and wait for some time after xbmc.RenderCapture().capture(width, height)
and before calling xbmc.RenderCapture().getImage()
Not had time to look into why it happens in CoreELEC, but capturing at too low a resolution results in the captured frame buffer not updating correctly. 32 KB of data or ~360p is a reasonable compromise in terms of speed, having to wait for too long, and getting the buffer to update correctly.
When using CoreELEC you will also probably need to play around with changing the doublewrite mode depending on what video decoder is being used and whether there is any frame compression happening.