I feel these rules are too rigid and this will depend on whether the app is mobile or desktop.

This is meant to be a framework so you can tweak it to come up with rules that make most sense for your work. I have provided example of rules (which you may find too rigid for your specific UI) for my data-heavy web application, based on this framework.

Mobile applications will definitely need a different spacing guideline, but you can possibly use a similar framework.

In my experience, consistency is definitely an issue the bigger the organization grows / the more complex the product becomes (even though big organizations have style guides). I have found examples of spacing systems which specify spacing values, but do not provide further guidelines on how to use space in UI — leaving it’s usage up to the discretion of individual designers and developers. This framework can help align both design and development teams around when to use how much space for every single piece in UI. Style guides (which usually just specify values) by themselves cannot bring about consistency across product, but aligning design and development teams around exact rules to apply these styles will!