It was passing the number of vertices to cogl_vertex_buffer_draw_elements but instead it should take the maximum index which would be the number of vertices minus one. This was causing errors to be reported with the checks filterset of Bugle.