What about example object moving upward and gravitational force downward.
If I take care of direction of displacement and force in opposite and put cos180, I get accurate result with proper sign. But if I don't put cos180 then I found sign problem.
In example of gravitational potential energy with upward motion.
∆KE = ∆PE Pls use this equation