Gravitational potential is negative because the reference point, at infinity, the g.p is defined to be zero. In my first derivation for work done by gravity to bring a mass from r to infinity, the results turns out to be negative, which makes sense and follows the definition as the object is moving in the opposite direction of gravity and gravity is doing negative work.
In my second derivation, I would expect the work done to be positive as the direction of gravity and direction of object is the same. From the maths point of view, it makes sense as I am swapping the limits and sign together, but I am confused about what it actually implies.