I suppose an error is happening just before the install finishes. But normally it should show the error and not redirect to the homepage (which then shows an update page because Flarum is not fully installed).
Maybe you are able to find PHP errors in the server logs (apache error log file).
Just a guess, maybe the database times out before the end of the install, and it can't finish performing the migrations. But I don't know why there wouldn't be any obvious error showing up.