I think you need to describe:
* what you actually see
* what you would like to see instead
* the results of each of the subexpressions (i.e. left and right of "or") in the PromQL browser
Then it should be clearer how to combine them to achieve the result you want.
The most important thing to note is that it's not a boolean: it's a union. An expression like "a or b" has a vector of values for "a" and a vector of values for "b". The result combines both timeseries a and b into the result set. However, if there are any metrics from "a" and "b" which match *exactly* the same set of label values, then only the "a" one will be included in the result set.
You can restrict the set of labels used for matching using "on(labels...)" or "ignoring(labels...)"
In your example: the subexpressions "sum by (nodename) (...)" will only have a single label {nodename="XXX"}, whilst the subexpression "machine_cpu_cores" very likely has more labels than that (job, instance etc) and may not have a "nodename" label at all. Since the labels of the LHS and RHS of "or" don't match, both sides are included in the result.