I am trying to calculate delta as mentioned, but unfortunately the result is not as expected.

Few examples (from Interactive Brokers platform):

SPY, expiration today, PUTs:

Strike 237, PUT midpoint price 0.835, Delta -0.696
Strike 236, PUT midpoint price 0.44, Delta -0.240
Premium price difference 0.395 is not near the deltas.

SPY, expiration in 28 days, PUTs:

Strike 237, PUT midpoint price 3.48, Delta -0.573
Strike 236, PUT midpoint price 3.08, Delta -0.513
Premium price difference 0.4 is not near the deltas.

DAX, expiration in 28 days, CALLs:

Strike 12650, CALL midpoint price 158.5, Delta 0.474
Strike 12700, CALL midpoint price 133, Delta 0.427
Premium price difference 25.5/50=0.51 is at least near the deltas, but it is not too precise.

I guess that the problem is, that with different strike not only Delta changes, but also Implied Volatility. So the calculation of Delta should be a bit more complex.

I think that I have to use contractVal.