Taking the tax free cash in isolation doesn’t restrict future contributions (other than if you were to use the tax free cash to make a substantial contribution which isn’t allowed).
It doesn't restrict it but you no longer get the tax benefit on the £40k element, I believe? As you say you couldn't wrap back money you've withdrawn, but equally you can't use earnt income against it either.