In SharePoint online, the below setting - whether it is enabled or disabled which control the behavior of whether the form should be opened in infopath filler or in the browser.
Enable or disable rendering of browser-enabled form templates. If you disable rendering, users cannot use a web browser to fill out the form and must use Microsoft InfoPath Filler 2013 to open the form.
Enable or disable publishing of browser-enabled form templates. If you disable publishing, form designers can publish only form templates that are not browser-enabled. In this case, all browser-compatible features are disabled in the form template.
By default, browser-enabled user form templates can be published and rendered.
How do I control this setting in modern admin center?
Go to the More features page of the new SharePoint admin center and sign in with an account that has admin permissions for your organization.
Under InfoPath, select Open.
In the User Browser-enabled Form Templates section, specify how you want user form templates to be processed by InfoPath Forms Services by completing the following steps:
a. Select the Allow users to browser-enable form templates check box to allow users to publish browser-enabled form templates.
b. Select the Render form templates that are browser-enabled by userscheck box to allow browser-enabled form templates that users publish to be rendered in a web browser.
- Select OK.
Read more about this in MSDN :
Configure InfoPath Forms Services
In the upcoming years, InfoPath form will be stopped by Microsoft. So, it is not recommended to go with infopath, as early as possible we should rebuild the form in powerapps or Nintex form if you have Nintex license.