Different content in a block per page
The trouble with this approach is that there are block definitions and block instances.  A block definition is the code or custom block that defines the block's behavior.

A block instance is what you create when you place a block onto your theme and defined its settings (e.g. nodes to display it on, values for custom fields).

To have different banners for each class using this method you would need to create a different block instance for each class.  (and set the display rules appropriately).

To use a single block, you will need to define a location outside the block that has the needed information.  Probably on your course page.  Then you can use either a view block as mentioned in the comments or write a custom block to pull the info.  If it is only needed on the main course page, you could probably just use a custom content type twig file and add it when the page is rendered.

If you need the block on subpages, e.g. secondary pages of a course, you will probably have to write a custom block that knows how to relate the subpage to the main course page. E.g. get the course information from a course entity reference field on the subpage and then get the banner info from the main course page).

Note that with both views and custom blocks, you will need to define the cache tags appropriately so that the content is cached per page and not overall.