Three years ago (which was pre-COVID, so forever ago!), that route was covered by a combination of buses from Manresa-Lleida-Huesca-Jaca once per day in the afternoon. Each bus was crowded, so it was a needed route at that time. Similarly, schedules were only available one month at a time. Took over seven hours, but I couldn’t find anything more direct. The train route was a similar set of train transfers.
In short, if I had to do it again, I’d return to Barcelona for faster, more direct options.