@pablob It’s 100% the training.
I am 6’ 1” and 260 lbs, and can reliably bang out 20-22 pullups at a max effort. Now granted, this is because I’ve trained them for years, but that is my point Pullups require a lot of lat strength, and losing weight is not going to change that. What it will do is make it easier to get to the point where you are strong enough to perform a pullup.
I recommend you start with negative pullups. Grab ahold of the bar and either jump or stand on a box or chair to get your chin over the bar, and then
slowly let yourself down. Aim for at least 5 seconds if you can. Do sets of those until you can perform at least a couple pullups and a stretch.
Some people like banded pullups, but I personally don’t think they help in the long run.