Private key to WIF compressed: which one is correct?
It seems that #1 is correct and not #2.


Yes, #1 is correct. The encoder will add the 01 flag byte to the end of the private key for you. By doing that manually in #2, you will result in the private key having an additional byte which is incorrect.