CSV is good because it's simple (easy to read, easy to implement, hard to break) and it's ubiquitous. If you're just trying to dump data without knowing/caring what the consuming application will be it's a fine choice. By using XLSX you've both lost that ubiquity and introduced a world of headache -- it's a lot easier to break XLSX export than CSV export.
For concrete examples CSV is best when you want to release the data from your system but really have no idea what the client wants to do. Maybe they just want to curl it and display it, maybe they want to process it with R. It's a very easy way to say "here's your data, my job is done".
But you argued before that CSV is not meant for at least one of your examples. If I want to process it in R, I need to know the datatype of the columns. And this is indeed a regular painpoint in this workflow.
For displaying it _might_ work, if you just want to dump an ugly mess. If you don't want to do that, you need to know the type of the values, so you can e.g. right-align numbers in columns.
So CSV clearly fails in your examples. You might argue that we don't have a better format that has support in so many applications. That might be true, but doesn't make CSV good or makes any of these failings not failings.