Mojave 10.14.6, LO 7.0.6.2

I’m using a mixture of the Randbetween/Choose functions in an attempt to generate two numbers in two cells between 1 and 8, the first being generated with RANDBETWEEN(1,8) (although is is currently a validated list with numbers between 1 and 8) and the second being any number except the first e.g. if the first number is 1, the second number can be any number except 1 i.e. numbers 2-8.

I’ve noticed upon testing this formula that certain numbers in the first cell elicit a “error 502” result in the second, but only intermittently; other times when the same numbers appear in the first cell a number, rather than error 502, is generated in the second cell.

Just wondering what this is all about, and how I can avoid an “error 502” generation. I haven’t really used Choose before so any assistance is greatly appreciated.

Thanks.