What happens to my older posts if I switch to a child theme?

Nothing would happen, everything would remain the same. Child themes inherit the functionality of the parent theme.

Just a few notes

  • All posts regardless of post type is stored in db, so they never “disappear” even when the post type does not exist anymore.

  • Custom post types and custom taxonomies should be registered in a plugin to keep them available even when you change themes