The function entity_create_stub_entity() has been removed in Backdrop 1.15. All entities in Backdrop will need to be real typed entities. The StdClass object does not work as an entity anymore, so we should be using entity_create() to create all entities now.

Before:

$ids = array($nid, $rid, 'page');
$page_node = entity_create_stub_entity('node', $ids);

After:

$values = array(
  'nid' => $nid,
  'rid' => $rid,
  'bundle' => 'page',
);
$page_node = entity_create('node', $values);
Introduced in branch: 
1.15.x
Introduced in version: 
1.15.0
Impacts: 
Module developers
Related Github Issues: 
https://github.com/backdrop/backdrop-issues/issues/4181