2 identical codes, calling the same Library. One with an error, the other works as intended

You probably installed v1.9 of the library... current version is 1.27...

But it has been superceded by RadioHead. Maybe you want to switch.