How can I make a custom post type sticky?

Your code runs only on post type archive pages. Unless your home page is a post type archive (doubtful) this code won’t run.

Change this:

if ( is_main_query() && is_post_type_archive() ) {

To this:

if ( is_main_query() ) {

And see what happens. The code will execute on every main query — every page–, including your home page. You should see the results you want on that page, but you can’t leave it like that. You will have to alter the function to only run on the home page. Something like:

if ( is_main_query() && is_front_page() ) {

Or:

if ( is_main_query() && is_home() ) {

I am not sure which you need given the limited context provided by the question.