So in summary almost all pilots see a heading that takes us off our FMC SID or STAR magenta line as a full change of clearance which cancels any published altitude or speed restriction.
Many controllers do not see this as a change of clearance and expect pilots to adhere to these restrictions.
There is no Documentation which totally clarifies this for the STAR case.
Maybe the only way to get a definitive answer on this is for a controller to file an alt bust against a pilot and publish the supreme judgement on here (not on the SFO - LGW 29th August)😏