You appear to have a bad copy of the raw transaction.
When I look at the raw transaction for txid in the blockchain (coinbase transaction for block height 486,273, block hash 00000000000000000083cbfd33b63c2ac10e703266c5749bf3ce2fbff88f5791), I get the following:
01000000 01000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00ffffff ff310381 6b07244d
696e6564 20627920 416e7450 6f6f6c6b
2f454231 2f414436 2f4e5941 2f332059
c36d7be1 550000df 320000ff ffffff02
38252e4d 00000000 1976a914 66037132
6d3a2e06 4c278b20 107a65da d847e8a9
88ac0000 00000000 0000266a 24aa21a9
edc11e8c dbd8d442 b27bf8f2 73395baa
83b5da4c 9c3d87fb c539dad7 42480437
10000000 00
When I calculate hashlib.sha256(hashlib.sha256(data).digest()).digest() on that data, I get the correct result.
You seem to be working with the following:
01000000 00010100 00000000 00000000
00000000 00000000 00000000 00000000
00000000 000000ff ffffff31 03816b07
244d696e 65642062 7920416e 74506f6f
6c6b2f45 42312f41 44362f4e 59412f33
2059c36d 7be15500 00df3200 00ffffff
ff023825 2e4d0000 00001976 a9146603
71326d3a 2e064c27 8b20107a 65dad847
e8a988ac 00000000 00000000 266a24aa
21a9edc1 1e8cdbd8 d442b27b f8f27339
5baa83b5 da4c9c3d 87fbc539 dad74248
04371001 20000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00
Notice the extra "0120" at the end followed by an extra 36 bytes of "00"?
Also notice that you have an extra byte of "00" between the 4-byte version (the 01000000) at the beginning, and the "01" representing the number of inputs?
Then notice that you have an extra "01" byte immediately following the in-counter?
These extra bytes are resulting in an invalid hash calculation.