No such number exists.
All digits in the resultant number starting from the $4^{th}$ number must be the end of some "block".
Primes can end with any odd digit, and out of the even digits, perfect squares can end only with $0$, $6$ and $4$. But even $0$ is not possible, because only for multiples of $10$ the squares end with a $0$, which means the square must have atleast $2$ zeroes at the end, but that would break the all distinct digits condition.
So the digits $0$, $2$ and $8$ cannot be the end of some block so these must be the first $3$ digits in some order. Let us try all paths we can take in decreasing order and see if we can reach a number. Basically we should choose the next digit such that last $4$ digits form a prime/perfect square and the digits are all distinct.
820 -> 8209 -> X
802 -> X
280 -> 2809/2803/2801
2809 -> 28093 -> 280937 -> 2809371 -> X
2803 -> 28039 -> 280397 -> X
2801 -> 28017 -> 280179/280173
280179 -> X
280173 -> X
208 -> 2089 / 2087 / 2083 / 2081
2089 -> X
2087 -> X
2083 -> 20839 -> X
2081 -> X
082 -> 0829 / 0827 / 0823 / 0821
0829 -> 08297 / 08293 / 08291
08297 -> 082971 -> X
08293 -> X
08291 -> 082917 / 082916
082917 -> 0829173 -> X
082916 -> X
0827 -> 08273 -> 082731 -> X
0823 -> 08237/08231
08237 -> 082371 -> 0823719 -> X
08231 -> X
0821 -> 08219 -> X
028 -> 0289 / 0283 / 0281
0289 -> 02897 -> 028971 -> X
0283 -> 02837 -> X
0281 -> 02819 -> X
All paths end with a dead end which indicates there isn't a valid number satisfying the conditions. Assuming I did not end up with a mistake at any step.