Which train did you book precisely ?
- EN Wien Hbf - Salzburg Hbf 23:27 - 02:12
- NJ Salzburg Hbf - Villach Hbf 02:30 - 04:42
- EN Villach Hbf - Rijeka 06:25 - 11:25
By leaving at 23:27 the journey is quite risky and you'll need to use 2 pass days. I'd recommend leaving earlier, night trains can get heavily delayed.
There is only one carriage between Stuttgart, Munich and Rijeka which is attached to a regular train in Ljubljana. Unsurprisingly it is full on 28th July.
Solution : there is a couchette available on 28th July between Munich/Salzburg and Ljubljana in a lady-only compartment.
If that doesn't apply to you, you could try to board a seating carriage as reservations don't seem to be mandatory from the Austrian border (per DB). However be prepared to sit/sleep on the floor…
In Ljubljana move to the regular train on which the couchette carriage is attached (departure 08:25).