How can you view the contents of another player's enderchest? [1.14]
Solution 1:
Your second command doesn't work because the ender chest as a block doesn't store the ender chest items of individual players. Whose items would you expect to get with that command? The command doesn't know.
The ender chest items are stored in a player's EnderItems
tag, so you get them for example with this command:
/data get entity @p EnderItems