How do I alter the page title after a controller sets the title? Is it possible to modify a page title after a controller sets #title in the main element? 

Normally you can modify the page title by setting _title or _title_callback in the route. However it seems that you cannot alter the page title if a controller sets #title.

(A correct answer would affect both the HTML &lt;title&gt; and the system title block.)
Yes, #title from the controller overrides the title set in the route. There doesn't seem to be another override to override #title.

Though you could try to alter the controller output in a KernelEvents::VIEW with a priority higher than 0 like this:

$result = $event-&gt;getControllerResult();
// change the controller output
$event-&gt;setControllerResult($result);




Metatag

Working on a project I found out, that the metatag module in default configuration gets the title with the token [current-page:title], which retrieves the title from the route, ignoring #title set in the controller. Most times this would be considered as an unwanted side effect, but in your case you get the title you want from the route title callback in HTML &lt;title&gt; and only have to take care of the page title block, which should be no problem in a preprocess hook.