How to use cron to delete nodes of a content type that does not allow deletion by anonymous users The background for this question is here: Delete nodes using Rules and VBO

Summary: a VBO View selects various nodes of a particular content type. A Rules Action Set is instructed to load this VBO View, loop through the entity objects, and delete them. A Rule runs/is triggered on cron and has this Action Set for its action. So, when cron runs the selected nodes should be deleted. 

However, the nodes are not deleted, because cron runs as the Anonymous User (uid=0), and the content type is configured such that anonymous users are not allowed to delete nodes of this content type. 

How can this be solved so that the nodes are deleted on cron? 

Giving anonymous users permission to delete nodes of this content type is not a good solution on this site. 

Presumably, cron runs as Anonymous User (uid=0) for security reasons. Any acceptable solution should not undermine the site's security. 

A programmatic solution (e.g. code in a custom module) is certainly acceptable if a "code-less" solution using Rules is not possible.
Not sure if you want to consider using it, but the Rules switch user module might be an acceptable compromise. Some details about it (from its project page):

This module adds two new Rules actions:

Switch to another user
Switch back from another user

These actions could be useful when you have an operation that you want an unprivileged user to use but it fails because the user doesn't have sufficient permissions.

Refer to the image on its project page to get the big picture. So if you'd add these 2 Rules Actions at the start / end of your list of existing Rules Actions, and you'd use some user id that does have the right permission, it should work.
As an alternative you could just reuse the relevant code (it's only 76 lines ...) to create your own custom Rules Actions. Similar to what you wrote in your question (= &quot;**...code in a custom module...&quot;).  If you make any useful improvements, please consider contributing your changes back to the module's issue queue.
Be aware, however, that this module only has a DEV version for D7 (= not covered by Drupal’s security advisory policy!). This doesn't mean that the module/code is dangerous to use/reference, but it does mean that the code has not been vetted by the Drupal security team.