Vyxal 2.7.1, 86 bytes
ƛf⁼;Ġ•vfƛf⁼;Ġ•
Surprisingly only 2 bytes off add++The link uses the latest version of vyxal (2.7.3 at the time of writing) which has a bug fix where molding no longer wraps singletons in lists, hence the extra vf
.
Explained
ƛf⁼;Ġ•vfƛf⁼;Ġ•
ƛf⁼; # For each item in the input, does the flattened version equal the item? For integers, this returns a list, which does not equal the item. For lists, this just returns the list - this wouldn't work if there wasn't any depth restriction.
Ġ # Group on consecutive items
• # and mold the input to that shape
vf # flatten each item - this is needed to wrap singleton numbers in lists.