To show custom order note programmatically in Woocommerce admin order details page you need to use ‘woocommerce_thankyou’ action hook. Here is the complete code:
function add_custom_order_notes( $order_id ) {
$order = wc_get_order( $order_id );
// Text for the note
$note = __("This is my test note", 'text-domain');
// Add note
$order->add_order_note( $note );
};
add_action( 'woocommerce_thankyou', 'add_custom_order_notes', 10, 1 );