Search function keeps resetting

Question: On Replit IDE internal brower, Why does a query to search for a product by ID only show the result for a brief moment before redirecting back to the query search page. This does not happen on an external browser like Microsoft Edge. On the edge browser, the display actually holds the page showing the result, whether the product is found or not found.

Repl link/Link to where the bug appears:

I know this doesn’t always happen on the internal webview
code snippet

public class WebServer {
// more code
private void handleSearchProduct(HttpExchange exchange) throws IOException {
    String response;
    if ("post".equalsIgnoreCase(exchange.getRequestMethod())) {
        Map<String, String> inputs = parseForm(exchange);
        FoodProduct product = foodProductDAO.getFoodProductById(Integer.parseInt(inputs.get("id")));
        if (product != null) {
            response = "<html><body>"
                + "<h1>Product Found</h1>"
                + "<table border='1'>"
                + "<tr><th>ID</th><th>SKU</th><th>Description</th><th>Category</th><th>Price</th></tr>"
                + "<tr>"
                + "<td>" + product.getId() + "</td>"
                + "<td>" + product.getSku() + "</td>"
                + "<td>" + product.getDescription() + "</td>"
                + "<td>" + product.getCategory() + "</td>"
                + "<td>" + product.getPrice() + "</td>"
                + "</tr>"
                + "</table>"
                + "<p><a href='/search-product'>Search for another product by ID</a></p>"
                + "<a href='/'>Back to main menu</a></body></html>";
        } else {
            response = "<html><body>"
                + "<h1>Product Not Found</h1>"
                + "<p>No product found with the given ID.</p>"
                + "<p><a href='/search-product'>Try searching for another product by ID</a></p>"
                + "<a href='/'>Back to main menu</a></body></html>";
        }
    } else {
        response = "<html><body>"
            + "<h1>Search for a Product by ID</h1>"
            + "<form action='/search-product' method='post'>"
            + "Enter product ID: <input type='text' name='id'/>"
            + "<input type='submit' value='Search'/>"
            + "</form>"
            + "<a href='/'>Back to main menu</a></body></html>";
    }
    
    sendResponse(exchange, response);
}