remove cache in hook_preprocess_node
You have to add cache tags of all entities you get data from. Add this line to the foreach loop:

$variables['#cache']['tags'][] = 'node:' . $schedule_entity-&gt;id();


The parent node is already tagged, which would also happen for the schedule entities if rendered normally.

This is all you need to do, adding the tags of the entities you use to build the rendered output. The entity system invalidates cache items, which are tagged correctly, automatically on all CRUD operations.