Hi!
As the title says, what happens if i get an address wrong? Do the coins get lost?
If that's what happens, why not change the code in Bitcoin, so that if the bitcoin network cant detect that address, returns the bitcoins to you?
It depends. One thing is sure, you don't have those coins anymore. If the address you have sent is owned by someone (he has private key), he will receive the funds and he can use them as he seems fit. And the changes you are proposing are not good for the following reason: what would stop someone from buying something, and after receiving the goods proclaiming the transaction as erroneous and receiving the funds back?