Is this edge orientation optimization problem NP-hard?
I believe that this problem is NP-hard, here is a sketch proof (don't hesitate to ask for more details if needed).
The idea is based on a reduction from the Not-all-equal 3-SAT. For $\varphi$ a 3-SAT formula with $m$ clauses, we will build $G(\varphi)$ a graph that has minimum objective value of $2\times m$ iif $\varphi$ has a solution. Before diving into the  building of $G(\varphi)$ let us show the gadgets that we will use.
Fixed node gadget:
The idea here is pretty simple. To fix a node $n$ in $G(\varphi)$ we make sure that $n$ has at least $2\times m+2$ neighbors in $G(\varphi)$ by adding nodes only linked to $n$. Once a node $n$ is fixed then any orientation with objective value less or equal $2\times m$ is such that $d_{in}(n)=0$ or $d_{out}(n)=0$.
Litteral gadget: For each variable $x_i$, we will create two fixed nodes $x_i$ and $\lnot x_i$ that will be linked together with an edge. Because the two nodes are fixed and linked, in any orientation of the graph with value less than $2m$, we will have either $d_{in}(x_i)=0 \land d_{out}(\lnot x_i)=0$ or $d_{out}(x_i)=0 \land d_{in}(\lnot x_i)=0$.
Clause gadget: The idea here is slightly more intricate. For each clause $C_j = l_1 \lor l_2 \lor l_3$ we will create three nodes $C_j^1$, $C_j^2$ and $C_j^3$ which are the red nodes in the graph drawn below. In this graph the three blue nodes will correspond to the three literals $l_1$, $l_2$ and $l_3$. Since the literals will be fixed nodes, we know the orientation for the blue-red edges (i.e. the dashed edges) and we want to compute the orientation of the red-red edges (i.e. the filled edges) that minimizes the objective value.

We can easily show that either all the dashed edges are in the same direction (i.e. all blue to red or all red to blue) in which case the minimum objective value is 4 or they are in diverse directions in which case the minimum objective value is 2.
Putting everything together:
If there is a solution to the not-all-equal problem we can orient the edges outward for true literals and inward for false literals and each clause triangle can be oriented in a way to have an error of $2$, therefore the overall error is $2\times m$. On the converse, if there is an orientation with error less or equal to $2\times m$ then we can retrieve a solution to the not-all-equal problem. Indeed, the fixed nodes have an in or out degree of 0 therefore we can say that literals with in degree equal to zero are true and the other are false. Since each literal is connected to its negation their value are coherent and it is a solution to the not-all-equal problem $\varphi$ because since each triangle clause has error at least 2 and the overall error is $2\times m$ it means that all triangle clauses are connected to a positive and a negative literal.