I have noticed that some posts on some Lemmy instances created by others have successfully made use of the details/summary tags which gives an arrow that expands.
When I tried it here, the tags are just literally printed. Am I doing something wrong (i.e. stupid user error), or is this functionality instance or version dependent?
I think you need to use Markdown and not bracketed tags.
Try the spoiler format:
https://join-lemmy.org/docs/users/02-media.html
You can also have a look at how other people did it. There should be a button somewhere to view the source text of any post or comment. In the Lemmy web-interface this button is hidden behind the three dots icon.