it is not "exactly" 17 million because in all these blocks there has been miners who messed with the code and made mistakes which meant they didn't take the block reward and that reward (that is newly genrated coins are lost forever). lost in this context means out of circulation and never entering it at all.
for example this one: https://www.reddit.com/r/Bitcoin/comments/7n1ie5/someone_destroyed_125_newly_mined_bitcoins/
Is there a way to calculate the exact amount of Bitcoins that are lost due to miner mis-configuration?
Looking at that thread, it does seem that it leaves evidence of such an event in the blockchain. Maybe someone already wrote a script to look for those errors?
there is a way, but i don't know if anyone has actually done it or not. you just have to take each block from block #1 up to the longest height. then check their coinbase transaction to see if it is claiming the block reward and the total fees or not.
the "evidence" is the link of that topic on reddit:
https://tradeblock.com/bitcoin/tx/9bf8853b3a823bbfa1e54017ae11a9e1f4d08a854dcce9f24e08114f2c921182