We aren't really sure if it'll be allowed. It's been discussed both by the media and on here. I think @Stephen made a thread on it.
Shortly after the season ended Friedman said with near certainty he doesn't think the NHL would allow it and would look into it and that Philly / Boston wanted clarity. Friedman can be a bit of a blowhard with the Leafs (remember the suspension stuff in years past?)
I can't remember if it was a tweet or an article but I think recently Link: someone said the NHL agreed that it's up to Toronto who gets the pick based on the conditions, but it wasn't clarified if that means Toronto could leverage that in a separate trade (for example: give us your 1st in 2027 for our 3rd in 2027 and we give the pick to you as a handshake agreement.)
Considering how the NHL is treating the Cassidy situation I think Toronto would have a strong case that they should be allowed to do this based on the conditions / language used. My assumption is that Toronto's 1st in 2027 would not in any way be allowed to be directly part of the trade and would have to be a handshake agreement. I supposed the team who doesn't get the pick could argue that's some form of collusion?
Edit: I don't see any issue with your scenario though. I assume Toronto would be allowed to trade for their own pick and obviously choose to pick if they want to use it.