Different hash while creating genesis block
Maybe this is useful for someone: I didn't find why the hash was different, it's possible that the code I used for generating the genesis block is outdated.

Finally I used https://github.com/lhartikk/GenesisH0 and it worked, the only caveat was that I only was able to change the timestamp, when I tried to change other stuff (e.g. nBits) it failed.