I run the same code by changing the initial slope parameter to m = 4. The first time I get an acceptance fraction: 0.2748 the second time 0.0.
I did a plot to see how the slope parameter varies with each iteration, during the second trial, it seems that the code is stuck at m = 4.
Does it has to do with how the metropolis-hastings method is being implemented?