This is likely because of Adam's suggestion -- you were incorrectly declaring a function that returned an immutable like this:
immutable T foo();-Steve
That's exactly what it was I think. As I stated before, I tried to do immutable(T) but I was drowning in errors at that point that I just took a step back. I'll try to refactor it back to using immutable. I just honestly didn't quite know what I was doing obviously.