You can get this error when trying to show a custom entity in a controller. Problem is probably your route. Make sure it has a "parameters" section pointing to the right entity type like:

contest.winner_detail:
  path: '/contest/wall-of-fame/{id}'
  defaults:
    _entity_view: contest.winner
  requirements:
    _access: 'TRUE'
  options:
    no_cache: 'TRUE'
    parameters:
      id:
        type: 'entity:contest'