How to Build Block Header in stratum?
You do not need append padding, this step already implemented under the hood in the cryptographic library function sha256. As I remember, when I solve the same task and read this doc from stratum pool a few inconsistencies in the documentation that had to be solved empirically. 

One of the nuances on which note that miners software do not know anything about the segwit and coinbase transaction for the miner job should be represented in the old format.