Your second snippet is closer to the solution, but with still some errors in the slicing.
Let’s visualize with some values:
train_size = 595
val_size = test_size = 198

Your validation split, as it is, will extract elements from index 595 to 198, which is empty!
Your test split will extract elements from index 198 to the end, which is 992 - 198 = 794.
You can check a tutorial on Python slicing here 27.