were the particular ... occasions when you were more likely to get spanked?
Hands down, report card days and especially evenings after P/T meetings.
My parents took school matters very seriously. My school did not spank, but dad totally made up for it at home with the paddle (age 10-13) and the belt (14-15). I'd say probably a half of my childhood spankings at home were due to school-related matters. If I got a behavior note from school or there was a call to parents from my homeroom teacher, or a poor report card, it pretty much meant a spanking at home.
What made a poor report card and whether it merited a spanking was decided by my parents. If they were seeing I was trying hard, they would not hold bad grades against me too much. (I may add that my mother was a middle school teacher, although not in the same school I and my brother went to, but another one, more distant from home.) But if they perceived bad grades as resulting from goofing off, then my prospects were more bleak. It all depended on how bad the grades were, if it was a continued pattern from the previous report card, if there were earlier notes home about not trying in class or about misbehaving at school, if the teacher wrote some notes in the report card... all those things that made my fate hang in the balance.
If I had recent behavior notes from school, this in particular increased a probability of spanking for bad grades. As my mother called it, "for bold behavior and quiet accomplishments".
There also were not too many P/T meetings after which I or my brother or sometimes us both did not get our bottoms spanked good. P/T meetings were always a big jeopardy for me and my brother, because that was when our parents could learn about things at school (our behavior and studying... or rather misbehavior and non-studying) that we have been trying to conceal, and did manage to conceal from parents until the meeting. And then our parents would learn about it all at once, resulting in a cumulative effect and causing peak wrath.
Furthermore, teachers at my school at the time were not as "politically correct" and did not try to put a nice or politely sounding face on the problems with kids' behavior or school effort when talking to parents, they talked in a very straightforward and critical way. And furthermore, I think teachers were (naturally for them) focusing on the problems, rather than the overall picture, or rather there was a bias towards the problems, so parents may have been getting a somewhat biased picture, without realizing it.
And when our parents were back from the P/T meeting (dad usually was the one to go) they took me and my brother to account for everything they learned about us during the meeting.
My brother and I were one grade apart at school, so P/T meetings for our classes were on different days, however P/T meetings for my brother's class were also a jeopardy for me, because my homeroom teacher was also one of the teachers for Tim's class, and more often than not she was present at my brother's class P/T meetings, and when my dad (or mom) attended Timmy's class P/T meeting they also inquired her about my progress and behavior too.
And when my dad was back from the P/T meeting with an unfavorable view of my or my brother's school effort and behavior, there'd be a big lecture, and we were sent to fetch the paddle from the closet.