I had another doubt about making my vector static , is it a bad practice?
Yes. But so is using recursion (in general in non-functional languages and in particular for this problem). So the point of this exercise is not about teaching you good practices, but to teach you various patterns of recursion. I guess it first teaches you the patterns and I hope it then tells you why and when you should and should not use them. If it does not explain the tradeoffs consider a better learning source (take a look at The Definitive C++ Book Guide and List)
Why is the above code slower than the code given below ?
The first version is objectively worst than the second because each call creates a new vector (the one you return). This will result in many unnecessary allocations.
The second version uses just 1 vector that you pass a reference to so it's more efficient than the 1st. Still it is worst than an iterative solution (non-recursive function with for loop).
A recursion solution for some problems can be easier and simpler to write. However considering performance a recursive solution in C or C++ will almost always be worst than the equivalent efficient non-recursive method. This is because each function call incurs a small performance penalty. The call stack is increased and decreased with each call. Besides the performance burden there is also the very real possibility of quickly exhausting the call stack causing a program crash.
When you find a problem that is more elegantly solved with recursion and you care about performance, every recursive algorithm can be easily transformed into a non-recursive function by using a queue to save the context that would have been saved with each recursive call.