This is a recent problem. Happens whenever I install/upgrade an add-on...any add-on.
I have to click "Continue Rebuilding" 4 or so times with the error reappearing each time. Then it completes add-on installation/upgrade. No errors logged in Server error log. No other issues noticeable.
In short... XenForo does lots of processing at save time to maximize performance at run time. It's a good trade, but sometimes you can exceed server limits during a rebuild.
To help rebuild time you should delete any excess styles, languages, groups, and nodes that you aren't using or don't need. Otherwise your solution is correct (click continue or refresh until it completes).
Only have 1 other style, 23 nodes. It only started happening within the past couple of months (when I upgraded Xenutiles). My server was apparently upgraded about three months ago and my backups (Sypex) are about three times faster since the upgrade. Odd thing is it does not seem like a time-out issue. It seems too consistent. What I mean is, when It starts the rebuilding caches step, it goes about 6 seconds before the error appears, then two, then two, then two, then 6 again, then about 10 when it finishes. Like it's hitting bad spots or something.