The issue you have is that you did not cancel the bookings before deleting the course. Technically you should not have deleted the course rather you should have delimited the course as well.
SAP is a relational database with many, many tables. When you deleted the course you did not delete the relationship of the person being booked into it. You would now need to find that relationship and remove that from the table as well. Once yo uhave removed that the user will no longer see the course in the Learner portal