WordPress options page not saving

You need to pay attention to $page parameter, if its not same anywhere it will not work.

<?php add_settings_field( $id, $title, $callback, $page, $section, $args ); ?>

$page

(string) (required) The menu page on which to display this
field. Should match $menu_slug from add_theme_page() or from
do_settings_sections()
.

https://codex.wordpress.org/Function_Reference/add_settings_field

<?php add_settings_section( $id, $title, $callback, $page ); ?>

$page

(string) (required) The menu page on which to display this section.
Should match $menu_slug from Function Reference/add theme page if you are adding a section to an ‘Appearance’ page, or Function
Reference/add options page if you are adding a section to a ‘Settings’
page.

https://codex.wordpress.org/Function_Reference/add_settings_section

<?php add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function); ?> 

$menu_slug

(string) (required) The slug name to refer to this menu by (should be
unique for this menu).

https://codex.wordpress.org/Function_Reference/add_options_page

And it should also be same in:

<?php settings_fields( $page ); ?>
<?php do_settings_sections( $page ); ?>
<?php register_setting( $page, $id ); ?>