The second argument of scanobjects is only required for the start action. Stop and abort actions did not and could work without them.
It appears that this was broken by #16240 which enforced the size of the arguments to match the listed required arguments.
To fix this issue, this PR makes the scanobjects argument an optional argument. Then only in the start action do we check whether the scanobjects argument is there and throw an informative error about that. Also a test is added for this case.
This is a backport of Core PR17728