To reproduce, open any of the examples and add a call to ctx.restore() before any other operations on ctx. The resulting image will be completely empty, which isn't what happens in the browser
Seems like cairo_restore does not check if you're on the initial state for some reason, or maybe it works differently than we expect
Cairo 1.14.6