This problem occurs often with scenes that have trees with the sky behind. I tend to raise the shadows and reduce the higligts (in RAW) to get a more pleasing image, I believe this is a normal thing to do.
Here is a [extreme] demo, original shot:
after raising the shadows (I raised more than usual to make the problem show more):
As you can see, dark has bright halo and bright has dark halo and I noticed that the darker the image the more apparent the effect. Here are my questions:
Is this a hardware or a software post processing artefact?
if it's hardware then do I have a faulty camera or is this normal?
is this the same problem that occurs with HDR shots?
and of course, can it be fixed?
The image was taken with a Sony a6300, 10-18mm lens
EDIT:
software used: tried both Luminar 2018 and Darktable
the attached images are just screenshots directly form the editing software