I was trying to extract the staking address from an address and I was able to do that by using the bech32 decode, getting the last 56 bytes and encoding back again.
The question is: following this, I needed to add
e1 (mainnet) or
e0 (testnet) and it worked perfectly. The only thing though is that I don't know the reason. I mean, solving isn't enough, I wanted to understand why it's necessary to add those bytes as prefix.