Assuming the inv(z) to the left of the bracketed expression means "inverse z-transform", I don't see how the expression from the textbook could be correct. Even if there is typo and the denominator should be (z+1)^2, it's still incorrect (missing negative sign).
I tested more than just the example given and they were all way off, ;--; I feel like there must be some context for these problems im missing to use this function
Keep in mind that iztrans only applies to inverting the unilateral z-transform. If your book examples are for the bilateral z-transform, then there could be an issue. But that's not the issue for the example cited in the question.
@Aidan, If it is deemed worthwhile for the MathWorks team to investigate the issue, you may take a screenshot of other z-transform problems from the textbook.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.