You balance a unicycle like this: the unicycle starts to fall, and you move the wheel in that direction until the contact patch is slightly ‘ahead’ of the fall.
On a narrow plank, that presents no problems in the forward/backward directions, because it’s a simple matter of accleration and deceleration.
But the side to side balance on a narrow strip is difficult. If your centre of mass (“centre of gravity”) moves 3 inches to the right, an the plank only lets you move your wheel 2 inches to the right, then you’re in trouble.
On a short plank, you will have enough control to keep the unicycle more or less on the vertical. On a longer plank, minor errors will cause a certain amount of wobble. Your attempts to correct the wobble may be imperfect, and the small errors will accumulate until you run out of “wobble room”.
Practice and confidence will reduce the problem, but it will always be there, whether you make 1 metre, 5 metres or 10 metres.
There is the other method of balancing to consider: arm and upper body waving. As a physics problem, this is complex. If you simply shift some of your weight to the right, there will be an equal and opposite reaction. This means that the unicycle might become more vertical, but the centre of mass of the combined unicycle and rider will not have moved laterally. So you you’re no better off. (A leaning unicycle or a leaning rider - either way, you’re out of balance.)
However, more can be achieved by circular movements of the arms. If you move your arms like aeroplane (airplane) propellors, then as the arm moves outwards over the top of it’s travel, it will have more effect than when it moves back inwards at the lower part of its travel. I think the term is ‘angular momentum’, but I’m sure someone will correct me.
Anyway, practise, and set steadily increasing goals and you will improve.