The cogs sequence is important because the grooves of the hyperglide system (or other brands similar system) follow each other on every cog.
If non sequential cogs are used, these grooves do not match each other.
The same apply for the chainrings that must be placed adequately.