'The alias is already in use' when editing a node that had an alias generated programmatically
Turns out whenever you perform this

\Drupal::service('path.alias_storage')-&gt;save("/node/" . $node-&gt;id(), $url_alias, "en");


It generates a new alias every time even if the path alias already exists. I was able to resolve the issue by performing checks to see if the path already exists like so:

if (!\Drupal::service('path.alias_storage')-&gt;pathHasMatchingAlias('/node/' . $node-&gt;id()) &amp;&amp; !empty($node-&gt;id())) {
    $path = \Drupal::service('path.alias_storage')-&gt;save("/node/" . $node-&gt;id(), $url_alias, "en");
}