How do I modify a node's body (or any field) on display as `hook_node_view`?
This should work, you are changing $build, which you don't need to return:

function textreplace_node_view(&amp;$build, $node, $display, $view_mode) {
  // your code for $text
  $build['body'][0]['#text'] = $text;
}