help using hook_url_outbound_alter() to append "#id" to node/edit url
The $options parameter passed by reference to the hook_url_outbound_alter() implementations is described as follows. (Emphasis is mine.)


  $options: A set of URL options for the URL so elements such as a fragment or a query string can be added to the URL.


What that documentation page doesn't explicitly say is that $options is the same array url() accepts, which includes the following array indexes.


  
  'query': An array of query key/value-pairs (without any URL-encoding) to append to the URL.
  'fragment': A fragment identifier (named anchor) to append to the URL. Do not include the leading '#' character.