There doesn't appear to be that much information available, although
https://www.undiscoveredscotland.co.uk/stirling/stirlingcastle/timeline.html does have some.
Basically a group of Scottish Nobles opposed to James VI captured the castle in 1584 but subsequently returned it to the Kings forces in May of that year. In 1585 the rebel group returned and again captured the Castle and after negotians returned it to the Authorities.
There is little to no information coming up about who they were -
although it might reasonably be considered that they were supporters of James mother Mary.According to "Scotland's Story" by H.E Marshall Prior to this James had been held prisoner by some of his own nobles. After some time he escaped and waited patiently before he began exacting his revenge - some of the nobles involved were killed and James' favourite Arran was freed from prison and also began a killing spree. Many of the nobles fled to England but later returned at the head of an Army and marched to Stirling to force James to listen to their grievances. he apparently did and Arran was banished.