I can’t figure out why the flash() in flask-admin isn’t showing for this specific case, while showing for others

I have been stuck with this problem for two days and I cant figure out why, when I use this method to generate the flash_message on flash_message2 and flash_message3 it works fine and it shows, when I attempt to return my actual one that I intend to return the flash_message the flash message doesn’t even show up, this is my code:

def generate_briefing_report(all_data_list, invalids_list, identifier_field: str, title: str = "Report",
                         operation_title="Operation Summary:", button_enabled=True):
formatted_operation_summary_top_message = ""

# All Valid OR partial valid
calculated_disparity = len(all_data_list) - len(invalids_list)
if calculated_disparity == len(all_data_list) or (
        calculated_disparity > 0 and calculated_disparity < len(all_data_list)):
    formatted_operation_summary_top_message += f"[✔] Number of successful operations: {calculated_disparity}"

# All are invalid OR partial Invalid
copyable_erroneous_values = None
if calculated_disparity == 0 or (calculated_disparity > 0 and calculated_disparity < len(all_data_list)):
    if formatted_operation_summary_top_message:
        formatted_operation_summary_top_message += "<br/>"

    formatted_operation_summary_top_message += f"[❌] Number of unsuccessful operations: {len(invalids_list)} "
    copyable_erroneous_values = ", ".join(record["order_number"] for record in invalids_list)

operation_summary_message = Markup(formatted_operation_summary_top_message)
valid_total = calculated_disparity
invalid_total = len(invalids_list)

copy_failed_button_html = ""
if button_enabled and copyable_erroneous_values:
    copy_failed_button_html = f"""
                    <button style="cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; border-radius: 5px; background-color: #f0f0f0;" onclick="var textArea = document.createElement('textarea'); textArea.value = '{copyable_erroneous_values}'; document.body.appendChild(textArea); textArea.select(); document.execCommand('Copy'); textArea.remove(); showToast();">Copy Failed to clipboard </button>
                    """ if invalid_total > 0 else ""

data_list = []
for index, record in enumerate(invalids_list, start=1):
    data_list.append([index, record[identifier_field], record["error"]])

settings = {
    "title": title,
    "identifier_title": identifier_field
}

error_id = str(uuid.uuid4())
session[error_id] = {
    'settings': settings,
    'data': data_list
}

report_url = url_for('error_report', error_id=error_id)
open_errors_view_button_html = Markup(f"""
                    <button style="cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; border-radius: 5px; background-color: #f0f0f0;" onclick="window.open('{report_url}', '_blank')">View Error Details</button>
                    """)

flash_message = Markup(f"""
                <div>
                    <strong>{operation_title}</strong><br/> {operation_summary_message} {open_errors_view_button_html}<br/><br/>
                </div>
                """)

flash_message2 = Markup(f"""
                <div>
                    <strong>{operation_title}</strong><br/> {operation_summary_message}<br/><br/>
                </div>
                """)

flash_message3 = Markup(f"""
                <div>
                    {open_errors_view_button_html}<br/><br/>
                </div>
                """)
return flash_message

when I attempt to flash this:

flash_message = Markup(f"""
            <div>
                <strong>{operation_title}</strong><br/> {operation_summary_message} {open_errors_view_button_html}<br/><br/>
            </div>
            """)

It just doesn’t show.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật