You are right, there is a bit of difficulty when it comes to calculating localized heat transfer coefficients in CFD or otherwise. Newton's law of cooling assumes that there is a uniform or constant bulk temperature of the fluid. The temperature difference is the subtraction of the bulk temperature of the fluid from the temperature of the solid surface. The CFD tool I use (SimScale) asks you to set a reference temperature which in the ideal case is your ambient temperature or the bulk fluid temperature. However, in cases where you have a fluid flowing through a cooling channel, the average temperature of the fluid often increases as you move further downstream. In that case, I would choose the inlet temperature of the coolant as the reference temperature. In the end, Newton's law of cooling and the heat transfer coefficient is a simplification based on the assumption of a uniform bulk fluid temperature.
You can find more information on how HTC is calculated in simulation here: https://www.simscale.com/knowledge-base/heat-transfer-coefficients-from-simulation-results/