Here's a randomized solution for you. First, create a table of possible sets. Given your constraints, there are only 5 possible sets of solutions. I put this table in cells B2:F10, with the headers in row 1. Note that this table can go anywhere, even on a different sheet if preferred. In a final product, I would probably hide these rows. Anyway, it looks like this:

Next, because you want a random number of columns, in cell A12 I put in a header called # of Columns and in cell B12 is this formula (feel free to adjust the upper and lower bounds to what you're looking for, this is just a random number between 3 and 10): =RANDBETWEEN(3,10)
Now we can setup our randomized columns and what sets they use:
In cell B14 and copied right (to the maximum number of columns
defined in the previous formula, so in this example it goes to K
because B:K is 10 columns), use this formula:
=IF(COLUMN(A14)>$B$12,"","Column "&COLUMN(A14))
In cell B15 and copied right is this formula:
=IF(B14="","",INDEX($B$1:$F$1,,RANDBETWEEN(1,5)))
In cell B16 and copied right and down for 9 rows (so in this example it is
copied to K24) is this formula:
=IF(B$14="","",INDEX($B$2:$F$10,MATCH(LARGE(B$26:B$34,ROW(B1)),B$26:B$34,0),MATCH(B$15,$B$1:$F$1,0)))
Finished, it will look like this (note that before completing the next step of this answer, it will show #NUM! errors, explained below):

You'll notice that third formula references a range we haven't built yet, in rows 26:34. In that range, there is another table full of randomized numbers so that the Sets can get scrambled to give us randomized results. Building that table is very easy. In cell B26 and copied over and down to K34 (again, over to the maximum number of columns and down for 9 rows), is this formula:
=IF(B$14="","",RAND())

Now with the randomizers, you'll get results as shown in the second image, with randomized sets of 9 numbers that sum to 10, consisting of 0s, 1s, and 2s. At this point you can cut/paste the Sets and Randomizers tables to a different sheet if preferred, or simply hide those rows.