I'm guessing that h is the handle that was returned when you first called figure. Those used to be doubles, but now they're "real handles". There are a bunch of details here , but the short version for your case is that to get the next figure, you need to add one to the figure's Number property, not h itself. Something like this:
figure(h.Number + 1)