In your code you need to replace this statement with following. $status-> assignState(\Magento\Sales\Model\Order::STATE_PROCESSING, true);.
The orders with status "Pending" is getting shown in the front end user account in My Orders section but the orders with other statuses like ...
Magento, show those orders at frontend whose status's Visible On Storefront field ... First, run below query at the database for make Visible On Storefront field ...
In addition to the preset order status settings, you can create custom order
You'll learn to create order statuses, assign an order status to a state, and more. ... custom status as default and make it visible to the customers on the front-end.
Configure all status in magento configuration as visible on front.
Visible on StoreFront – Tick the checkbox if you want to make this status visible from the frontend. Click Save Status Assignment. Steps to Edit ...
In the frontend site, customers can vew all their orders correctly. After run "php bin/magento cron: run" also into the admin order grid, all orders are visible and status is updated.
Magento uses Order States for processing orders internally and each order
STEP 2 : Assign an order status to a state :