There are more blocks using Magento_Catalog::product/view/addtocart.phtml, but you haven't declared view_model so you get this error.
To find which blocks using this phtml file, find "Magento_Catalog::product/view/addtocart.phtml" in vendor/magento directory.
There are 4 blocks in 3 layout files using this phtml: Magento_Catalog/layout/catalog_product_view.xml, Magento_Bundle/layout/catalog_product_view_type_bundle.xml, and Magento_Wishlist/layout/wishlist_index_configure_type_bundle.xml.
Finaly, to use View Model in Magento_Catalog::product/view/addtocart.phtml, you have to declare view_model to 4 blocks:
app/theme/<Vendor>/<themeName>/Magento_Catalog/layout/catalog_product_view.xml:
<referenceBlock name="product.info.addtocart"> <arguments> <argument name="view_model" xsi:type="object">Tavant\Catalog\ViewModel\OversizeViewModel</argument> </arguments> </referenceBlock> <referenceBlock name="product.info.addtocart.additional"> <arguments> <argument name="view_model" xsi:type="object">Tavant\Catalog\ViewModel\OversizeViewModel</argument> </arguments> </referenceBlock>
app/theme/<Vendor>/<themeName>/Magento_Bundle/layout/catalog_product_view_type_bundle.xml:
<referenceBlock name="product.info.addtocart.bundle"> <arguments> <argument name="view_model" xsi:type="object">Tavant\Catalog\ViewModel\OversizeViewModel</argument> </arguments> </referenceBlock>
app/theme/<Vendor>/<themeName>/Magento_Wishlist/layout/wishlist_index_configure_type_bundle.xml:
<referenceBlock name="product.info.addtocart.bundle"> <arguments> <argument name="view_model" xsi:type="object">Tavant\Catalog\ViewModel\OversizeViewModel</argument> </arguments> </referenceBlock>
Don't forget to clear cache (layout type) after making the changes.