Seach and categories not working when ignoring sticky posts in main loop

I see two issues in your code.

First, you pass what could be a string into post__not_in, which accepts an array of posts IDs (that’s fine if your option holds an array of IDs, but always good to verify).

Second, you seem to be repeating the same thing twice: you modify the query with pre_get_posts hook, and then you do it again by passing something into query_posts. In the documentation (this page, the posts_per_page part), they demonstrate the two techniques as alternatives of doing the same thing.