Blame the triceps
The bottom of the bench is chest and shoulders, the top is triceps. If you stall in the last few inches, prioritise triceps strength and top range work rather than more full range benching.
Weak lockout is usually triceps, so add close grip bench, board or pin presses, and overload the top with heavier partials.
The lockout portion of the bench is driven mainly by your triceps, so a lockout that stalls means the triceps are the weak link. Add close grip bench, board presses, floor presses, and pin presses from just above sticking height to build strength in the top range. Overhead and rope pushdowns for triceps hypertrophy help too. Train the lockout with heavier loads through partial ranges since you can handle more there.
The bottom of the bench is chest and shoulders, the top is triceps. If you stall in the last few inches, prioritise triceps strength and top range work rather than more full range benching.
Board presses, pin presses, and floor presses let you load the lockout range with heavier weight than a full bench, teaching your triceps to finish. Set the pins or board just below where you stall.
Add close grip bench for 4 to 6 reps and heavier overhead extensions and pushdowns. Also keep your elbows driving under the bar at lockout rather than letting them drift, which keeps the triceps in a strong line.
Weak lockout is usually triceps, so add close grip bench, board or pin presses, and overload the top with heavier partials.