Customer account button appears on dashboard but not on order detail page in Magento 2

I’m implementing a cancellation button for EU regulation compliance (required from June 2026) in Magento 2.4.7. The button needs to be accessible from the customer account area.

Current situation:
The button shows correctly on the account dashboard (/customer/account/) but doesn’t appear on individual order detail pages (/sales/order/view/order_id/123/).

My layout XML (customer_account_index.xml):

<referenceContainer name="content">
    <block class="MagentoFrameworkViewElementTemplate" 
           name="custom.button" 
           template="Vendor_Module::button.phtml"
           after="-"/>
</referenceContainer>

What I’ve tried:

  • Copying the same block to sales_order_view.xml → button still doesn’t show
  • Using <referenceBlock name="sales.order.info"> → no effect
  • Clearing cache multiple times

Question: What’s the correct way to make a block appear on both customer dashboard and order detail pages? Do I need a different container/reference for the order view page?