Is it possible to set the browser type directly in the katalon studio script?

Yes, it is possible. I have ever done similar programming. This involved a lot of work. It required me very careful Test-driven development using JUnit4 inside Katalon Studio. This is not as easy as you may expect.

The core part is com.kms.katalon.core.webui.driver.driver.DriverFactory#changeWebDriver(org.openqa.selenium.WebDriver)

What you need to do in your script.

  1. Create instance of org.openqa.selenium.WebDriver of the Browser type you want (Chrome, Headless Chrome, Firefox etc), this will open a new window which is not yet recognised by Katalon Studio
  2. call DriverFactory.changeWebDriver(yourWebDriverInstance), this makes Katalon Studio aware of the browser process you created and let KS to communicate with it when you call WebUI.* keywords.

You can keep multiple browser windows (Chrome and Firefox) open, and let Katalon Studio talk to either of them by calling DriverFactory.changeWebDriver(eitherOf2WebDriverInstances) back and forth.

But I wonder if you really want to do this complicated thing. May be not.