Keep the wordpress custom type, after disabling theme?

You can use unregister_post_type('slug') – where ‘slug’ is the CPT, such as ‘portfolio’ or ‘book’ or whatever your particular CPT is, and then re-register the CPT. I would suggest doing this in your own custom plugin so you can change themes freely.

So if your CPT is ‘portfolio’ you can create a file in /wp-content/plugins/wpse_360145_create_cpt/create-cpt.php:

<?php
/* Plugin Name: Create CPT */

// Run everything when the plugin is activated
register_activation_hook(__FILE__, 'wpse_360145_activation');
function wpse_360145_activation() {
    // First, unregister the post type
    // (be sure to set this to *your* CPT)
    unregister_post_type('portfolio');
    // Next, re-register it from scratch
    // (You may have to play around with the settings)
    register_post_type('portfolio',
        array(
            // Plural, human-readable label for menu
            'label' => 'Portfolio Pieces',
            // Show in REST API must be true for the Block Editor
            'show_in_rest' => true,
            // Enable Title, Editor, and Excerpt
            'supports' => array('title', 'editor', 'excerpt'),
            // has_archive will create http://example.com/portfolio
            // much like a Post Category archive
            'has_archive' => 'portfolio'
        )
    );
}
?>

There are a number of other settings CPTs can have, so you may have to look up each parameter and adjust to make the CPT work exactly the way you want it to. See register_post_type() in the Code Reference.

With this approach, you just activate the plugin to try the settings, and if anything needs tweaking, deactivate, make the changes, and reactivate, and the unregister_post_type() call will make sure the old attempt is completely cleared out.