Why in some transactions the public key after R and S is longer 33 bytes and in others is 65 bytes? There's a difference during the signature check?
ah, indeed that was not clear to me. The input sigscript is composed of two parts, the signature itself, and the following "condition", that need to be met for spending the tx. Usually this is a public key, but can also be multisig elements or smart contracts.
In the case where a public key follows, there are two representations of public keys: compressed keys and uncompressed keys. How they are generated is explained in a thread here: How are compressed PubKeys generated?. So you can have this representation:
pubkey hex uncompressed (04 + x + y):
04 50863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B2352 2CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6
or this: pubkey hex compressed (02 + x, y=even):
In the case where y=odd, then a 03 is at the beginning. Looking at the length, you have 65 for uncompressed, and 33 bytes for compressed keys.