Christian,
There are just incomplete pieces of code here. I cannot compile your wsn-application/leach because you did not include all the necessary files.
Even if you provide the files, I am also guessing this is for an old version of ns-3. A combination of this things makes it very hard to find your issue.
That being said, I recommend the following:
a) Always use the latest ns-3 version, we might have already patched the problem you are having.
b) Turn on the logs for the BasicEnergySource and/or the WiFiRadioEnergyModel, you might be able to catch an odd behavior looking at the outputs.
c) Try to reproduce the problem in a script that does not involve a lot of original generated content. If you provide such script I can run it and look more
into it.