It's possible to have different reactions to the same drug :)
As someone that is a heavy longtime user and recently diagnosed ADHD (there is a deep relationship between cannabis/substances and ADHD), I did find during the pandemic that smoking cannabis prior to writing software made it feel more productive. Given I couldn't prove that I was really more productive, and there are other costs, I decided against using it at least for my full time job. This is all to say, YMMV with cannabis or any psychoactive substance.