Those are idiomatic uses of prepositions, which can be tricky. I recommend you search "prepositions after adjectives" and "prepositions after verbs" to improve your fluency with prepositions, though these two topics don't address your question. It is quite a job to get a good grip on preposition usage.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
Anonymous "i had a good time on our photoshoot"-"i got it right on my first try"You have used the correct preposition in both sentences.
Anonymous How do i use "on" for certain situation like for example - "i had a good time on our photoshoot"-"i got it right on my first try"It may be argued that those are two different situations. This one is more or less unique (as many cases are):