Thanks for reaching out! I believe the issue here is that you have no dimension on the view to break up the data. Tableau aggregates data passed to Python to the visual level of detail, and in this case, the sum of sales and the sum of profit create a single row of data, which causes an error in calculating a correlation. You need to add the dimension that you want to create rows in the data, ie Customer Name, to the visualization to create enough rows to calculate a correlation.
You also want to make sure that your table calculation is addressing that dimension, not using it as a partition.